www.webdeveloper.com
Results 1 to 3 of 3

Thread: Form validation

  1. #1
    Join Date
    Apr 2014
    Posts
    36

    Form validation

    What is a simple javascript function I can use to produce a validation error when submit is pressed on a form?
    For example if the name field is not filled out a message will appear under the field itself indicting that this is a required field?
    Thanks

  2. #2
    Join Date
    Oct 2013
    Posts
    610
    HTML5 version:
    Code:
    <input type="text" id="name" name="name" required>
    The required attribute will do exactly as you want. However, it is absolutely not a substitute for server-side validation. In the case of text inputs all required really does is check for empty.

  3. #3
    Join Date
    May 2014
    Posts
    9
    You should need tp update it from internet.

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