SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: JS Verification

  1. #1
    Idler. Chazzy's Avatar
    Join Date
    Jan 2004
    Location
    Uk
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS Verification

    Morning,

    I have a question which im hoping one of you guys can answer for me please.

    I have a html form which then pipes to a phpmail script to mail the information to myself, I would like to add some form of verification to ensure a user cannot just send a blank form.

    Each field has a 'default' value which I think i could probably use to set a kind of check up such as if $blah == "default value here" die kind of effect...

    How would anyone tackle this idea?

    Many thanks for your time folks -- I appreciate it

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The default value of most form elements is stored in a variable (e.g., Ref_to_text_input.defaultValue) - so you can check this programmatically. That won't confirm that the user hasn't simply emptied the field (or entered garbage), so, might as well design a validator that does it all. Would need to know what 'all' is before recommending anything, though...
    ::: certified wild guess :::


Bookmarks

Posting Permissions

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