Skip to main content
Participant
March 11, 2020
Question

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

  • March 11, 2020
  • 2 replies
  • 510 views

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 has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
March 11, 2020

In your script I guess you should replace:

var cStr = event.target.value

 

By:

var cStr = event.value

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
March 11, 2020

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

Acrobate du PDF, InDesigner et Photoshopographe