Copy link to clipboard
Copied
I am trying to remove the (dot) in the textfield and move the cursor to the next field.
There are two fields, one field is for price and the next field is for the cents. but when every time I press the (dot) key, it doesn't update the field.
here's my script: (DOCUMENTS JAVASCRIPTS)
function goNext(item,event,cName){
// keystroke filter for numeric data only - change for other character filters;
AFNumber_Keystroke(0,0,0,0, "",true);
if(event.rc && event.change == ".") {
var cStr = event.target.value
var cStr = cStr.replace(".","");
event.value = cStr; <--- this area doesn't work.
item.getField(cName).setFocus();
}
Custom Keystroke Script:
goNext(this, event, "CENTS");
Copy link to clipboard
Copied
Why don't you use a single field with a normal "number" format?
Copy link to clipboard
Copied
In your script I guess you should replace:
var cStr = event.target.value
By:
var cStr = event.value