Results 1 to 2 of 2

Thread: Form validation

Hybrid View

  1. #1
    Join Date
    Apr 2014

    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?

  2. #2
    Join Date
    Oct 2013
    HTML5 version:
    <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.

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