Previous | Next | (P-PDF) JavaScript
Topic: Not allow hyphen in character 30, 60, 90, 120
Conf: (P-PDF) JavaScript, Msg: 66087
From: lmp
Date: 6/2/2002 04:33 AM
Hi,
I have write jscript for limit hyphen:
When the users key in any letter what they want, but when they key in hyphen(-) in the 30th of character, 60, 90, and 120. The message comming up
I put my script in Keystroke Custom Script:
//this is not allow the hyphen in any position of character in the field
var astring= "-"
for (var i = 0; i
if(astring.indexOf(event.change.charAt(i))!=-1) {
app."NOT ALLOW TO ENTER HYPHEN IN CHARACTER 30, 60, 90")
event.rc = false;
}
Because the fields have to populate to the other fields. I try to limit hyphen(-) in character 30, 60, 90, 120
this is my new script in STROKEKEY CUSTOM SCRIPT:
var theString="1234567890qwertyuiop[]\asdfghjkl;'/.,mnbvcxz-+=\r";
var SecondString="-";
for ( i = 0; i
if ((theString.indexOf(event.change.charAt(i))== -1)&&
((SecondString.indexOf(event.change.charAt(29))!= -1)||
(SecondString.indexOf(event.change.charAt(59))!= -1) ||
(SecondString.indexOf(event.change.charAt(89))!= -1) ||
(SecondString.indexOf(event.change.charAt(119))!= -1))) {
//not allow to enter the "-"
app."not allow to enter the hyphen in position 30, 60 , 90 only.")
event.rc = false;
}
}
}
I don't know what I miss something in my script. Why my script is not working as my expect.
Thanks in advance.
cindy