Error Checking ?

Results 1 to 3 of 3

Thread: Error Checking ?

  1. #1
    Disorder Guest

    Default Error Checking ?

    Any idea how , lets say i want to force the user to type enter data in a form , and mayb pop up an error if they try to submit with out it. <BR>thanx<BR>

  2. #2
    E! Guest

    Default RE: Error Checking ?

    Client side javascript:<BR><BR>function isBlank(s)<BR>{<BR> var len=s.length<BR> var i<BR> for(i=0;i&#060;len;++i)<BR> {<BR> if(s.charAt(i)!=" ")<BR> return false<BR> }<BR> return true<BR>}

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default i guess...

    just to make it a bit clearer call the isWhitespace function in the on click event of the submit button<BR><BR>function isEmpty(s)<BR>{ <BR>return ((s == null) &#124&#124 (s.length == 0))<BR>}<BR><BR><BR>function isWhitespace (s)<BR>{<BR>var i;<BR>if (isEmpty(s)) return true;<BR>for (i = 0; i &#060; s.length; i++)<BR>{ <BR>var c = s.charAt(i);<BR>if (whitespace.indexOf(c) == -1) return false;<BR>}<BR>return true;<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