Results 1 to 2 of 2

Thread: Username

  1. #1
    Join Date
    Dec 1969

    Default Username

    Hi,<BR>I want to use javascript validation on a form to check that users enter in only 4 numeric digits as a "userpin"<BR>I also want to check that they enter a value in the text box.heres my attempt...<BR><BR>(RegForm.username.value =="" &#124&#124 isNaN(RegForm.username.value)&#124&#124 (RegForm.username.value????? )<BR> {alert("You must enter a 4digit numeric pin");}<BR> else if<BR><BR>any ideas??

  2. #2
    Join Date
    Dec 1969

    Default Regular expression!

    Absolutely the only thing to use. <BR><BR>var re = /^dddd$/<BR>val = document.RegForm.username.value;<BR>if ( ! re.test( val ) )<BR>{<BR> alert("Dork! Can&#039;t you follow directions?");<BR>}<BR>

Posting Permissions

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