Skip to main content
Participant
Mar 11, 2020 2:26 AM UTC
Question

(HELP!)Trying to remove the (dot) in the textfield after pressing the (dot) key

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");

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

JR Boulay
Community Expert
Community Expert
Mar 11, 2020 10:23 AM UTC

In your script I guess you should replace:

var cStr = event.target.value

 

By:

var cStr = event.value

Translate
Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
Mar 11, 2020 8:37 AM UTC

Why don't you use a single field with a normal "number" format?

Translate
Acrobate du PDF, InDesigner et Photoshopographe