www.webdeveloper.com
Results 1 to 4 of 4

Thread: Validate hidden field is left blank

  1. #1
    Join Date
    Feb 2009
    Posts
    2

    Validate hidden field is left blank

    Looked for answer in this forum & many other places, can't see it. Just want to know how to ensure a hidden field is left blank using form validation. Area in blue is where I am stuck.
    Code snippet follows :
    ...
    frmvalidator.addValidation("Email","req", "Please enter your e-mail address");
    frmvalidator.addValidation("Hidden","req", "No data please");
    </script>
    ...
    Thanks for any help or direction you can give!

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Why would you validate a hidden field, the user can not change it's value.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    The only way that makes sens is if it is a regular input field that is hidden via CSS so that real visitors don't see it but spambots do.

    You would then perform the validation that the field is empty on the server since the spambots will also have JavaScript disabled.
    Stephen

  4. #4
    Join Date
    Feb 2009
    Posts
    2
    Sorry, should have mentioned that is what I was doing (using CSS to hide field & get around spambots).

    Again, sorry for my ignorance, but how would I validate it on the server? Using ASP.net so in the gdform.asp file?

    Thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles