This topic is locked

How to skip the entry of a field with the Lookup wizard

7/8/2020 5:38:19 PM
PHPRunner General questions
C
caese author

Greetings to all:

With the Loockup wizard I am doing an Add operation.

In a table I have four fields: Code, Description, Storage, Quantity.

In a first operation, when entering a new Code, I have no problem entering the other three fields.

When I enter the code again, in a new Add operation, I have no problem filling the Description field with the autofill

What I want is that the edit cursor does not remain in the Description, which already has a value and I do not want to modify it, but rather that it goes directly to the Storage field, as if the Description field were readonly.

I think that it can be done, but I dont find how.

Thanks since now.

W
wehaye 7/8/2020



Greetings to all:

With the Loockup wizard I am doing an Add operation.

In a table I have four fields: Code, Description, Storage, Quantity.

In a first operation, when entering a new Code, I have no problem entering the other three fields.

When I enter the code again, in a new Add operation, I have no problem filling the Description field with the autofill

What I want is that the edit cursor does not remain in the Description, which already has a value and I do not want to modify it, but rather that it goes directly to the Storage field, as if the Description field were readonly.

I think that it can be done, but I dont find how.

Thanks since now.


Include screenshots or videos related to your case to make it easier for others to analyze problems and provide solutions.

Not only writing.

C
caese author 7/8/2020


https://imgur.com/a/DoY1GKp
I put a image in "https://imgur.com/a/DoY1GKp"
In the first image on the left, the user enters a previously entered code, which already has a description, and applies it with the wizard lookup.

I do not want the user to be able to modify the description they already have.

In the image of the center, it is seen that the user is enabled to modify the Description field, which is what I want to convert into Readonly.

I hope the problem is understood. Thank you in advance.

G
Grdimitris 7/9/2020

try this on Javascript OnLoad event

var scode=Runner.getControl(pageid,'code');

var sdescription=Runner.getControl(pageid,'description');
scode.on('change',make_desc_read_only);
function make_desc_read_only(){

var descr=sdescription.getValue();

if (descr==""){

sdescription.makeReadWrite();} else {

sdescription.makeReadonly();}
}
C
caese author 7/9/2020

Thank you very much, Grdimitris for your solution, and to root@panel for advising me to upload an image of the situation, which helped me a lot to explain the problem.
Grdimitris: I have modified the code with the solution you have advised me, and in principle, I was able to reach a result quite close to what I wanted.
I only have one doubt that I have tried to reflect on the link https://imgur.com/a/2O2f8cn
If I enter the complete code by hand, as you advised me, the entry happens and the description field becomes readonly, as seen in the image on the left.
But if I enter the beginning of the code to select it from the list, as seen in the image of the center ...
... the description field is enabled to be modified, as seen in the image on the right, and that is the effect that I wanted to avoid.
Is it possible to not need to write the code completely?
I repeat my thanks.

D
david22585 7/10/2020



Thank you very much, Grdimitris for your solution, and to root@panel for advising me to upload an image of the situation, which helped me a lot to explain the problem.
Grdimitris: I have modified the code with the solution you have advised me, and in principle, I was able to reach a result quite close to what I wanted.
I only have one doubt that I have tried to reflect on the link https://imgur.com/a/2O2f8cn
If I enter the complete code by hand, as you advised me, the entry happens and the description field becomes readonly, as seen in the image on the left.
But if I enter the beginning of the code to select it from the list, as seen in the image of the center ...
... the description field is enabled to be modified, as seen in the image on the right, and that is the effect that I wanted to avoid.
Is it possible to not need to write the code completely?
I repeat my thanks.


Try this

var scode=Runner.getControl(pageid,'code');

var sdescription=Runner.getControl(pageid,'description');
scode.on('keyup',make_desc_read_only);
function make_desc_read_only(){

var descr=sdescription.getValue();

if (descr==""){

sdescription.makeReadWrite();} else {

sdescription.makeReadonly();}
}


I changed "change" to "keyup".

C
caese author 7/16/2020

Thanks for your suggestion, but the problem continues the same way ...