Copy link to clipboard
Copied
I have a read-only field with the 3 of 9 barcode font to accept input from a pop-up response window. When you click on the barcode field, the response window does pop up and accepts the input value, but when clicking on OK, the barcode does not change. Only when another action is taken afterward does the barcode change. I have the script below in the Mouse Up action of the barcode. How can I have it change the moment you click OK?
var cRtn = app.response("Please enter barcode number", "Barcode");
if(cRtn != null)
{
this.getField("txtBarCode").value="*" + cRtn + "*";
}
Copy link to clipboard
Copied
Add a invisible read only field, named "focuss" in this example, and add this line at the end of the script :
var cRtn = app.response("Please enter barcode number", "Barcode");
if(cRtn != null) {this.getField("txtBarCode").value="*" + cRtn + "*";}
this.getField("focuss").setFocus();
Copy link to clipboard
Copied
Add a invisible read only field, named "focuss" in this example, and add this line at the end of the script :
var cRtn = app.response("Please enter barcode number", "Barcode");
if(cRtn != null) {this.getField("txtBarCode").value="*" + cRtn + "*";}
this.getField("focuss").setFocus();
Copy link to clipboard
Copied
Thank you very much, JR! That worked but leaves the cursor blinking wherever I have set that field. Would I be able to use the "setFocus" on an already existing field to simply have the cursor sitting there for the user's next input?
Copy link to clipboard
Copied
"Would I be able to use the "setFocus" on an already existing field to simply have the cursor sitting there for the user's next input? "
Yes, just replace "focuss" in the script by the field's name :
var cRtn = app.response("Please enter barcode number", "Barcode");
if(cRtn != null) {this.getField("txtBarCode").value="*" + cRtn + "*";}
this.getField("focuss").setFocus();