Previous | Next | (P-PDF) JavaScript
Topic: Not allow hyphen in character 30, 60, 90, 120
Conf: (P-PDF) JavaScript, Msg: 66167
From: lmp
Date: 6/4/2002 12:30 PM
Hi Jon,
Thanks for your help.
Cindy
On 6/2/2002 4:33:39 AM, lmp wrote:
>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.chang
>e.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="1234567890qwertyuio
>p[]\asdfghjkl;'/.,mnbvcxz-+=\r
>";
>
>var SecondString="-";
>
>for ( i = 0; i
>
>{
>if
>((theString.indexOf(event.chan
>ge.charAt(i))== -1)&&
>((SecondString.indexOf(event.c
>hange.charAt(29))!= -1)||
>(SecondString.indexOf(event.ch
>ange.charAt(59))!= -1) ||
>(SecondString.indexOf(event.ch
>ange.charAt(89))!= -1) ||
>(SecondString.indexOf(event.ch
>ange.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
>