Results 1 to 2 of 2

Thread: Urgent

  1. #1
    Join Date
    Dec 1969

    Default Urgent

    Hello all.,<BR>I have a javascript doubt.. the thing is that i need to check in a text box whether the user enters only valid characters.<BR>I need to check for caharacters which includes my alphabets and it should reject all invalid characters like &*(,,,, and also numbers. The code below does the same but i need to check for blank also.But Blank is acceptable.<BR>Can anyone just look the code below and help me out.... <BR><BR><BR><BR>for (var i=0,valid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM NOPQRSTUVWXYZ" ; i&#060;string.length; i++)<BR> if (valid.indexOf(string.charAt(i)) != -1)<BR> {<BR> document.Frm1.Text1.select();<BR> document.Frm1.Text1.focus();

  2. #2
    Join Date
    Dec 1969

    Default This might be a good place to use ..

    regular expressions. There are plenty of good articles here on 4guys describing how to use them. Take a look.<BR><BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts