SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to validate forms when user has turned off javascript

    Hi,
    I'm coding a form whose data is going to some emails addresses.. not a server. i am using jquery for validation but what should be done if the user has turned off javascript
    Thanks
    Meera

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    You should never rely on JavaScript for something like this. It's the wrong tool. You should rely on a script that will work in all cases—like PHP—and then, if you wish, enhance it with JS for those who have it on.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    You can't send forms directly to an email address - most browsers when given a form where the action points to an email address will just ignore the form and open the email program to create a new email to send to that address with whatever subject line and content that they type into their email program.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,433
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you probably gonna need some sort of server scripting for this. like folks above said javascript is not much reliable for validation.
    if you use php you can post to the script processing it, where you can check the data input.
    if you use .net its even easier, you can check input from the postback function for the submit button.


Tags for this Thread

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
  •