Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

jQuery form validation - super easy

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
13,582
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 5, 2009

I made a function that makes it super easy to validate forms. the new thing here is that it can find the text that belongs to an element and color it red.

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (optikalefxx)

  • I think that's bad code, it only checks for validation,

    plus it should use custom attributes such as data-header="id" as suggested by html5

  • @tapgyn Honestly I use the jquery plugin "jquery validation". Its great. I don't use this function anymore.

  • awesome tutorial,

    liked it,, I just started with jquery today and I totaly get what you are saying,, I really like it and I just made something like this with your help and extra stuff in it too make it nicer,, You make it all so clear,, Thnx man

  • Thanks. Make sure you add validation for email too, I didn't show that.

  • I just maked it too test,, not gonna use it,, but how can i do that in javascript?

    Grtz

  • there are a few ways, some better than others. The fool proof way is to use Regex to test for the email pattern. The simple way is to just test for the existence of a period and and @ sign.

see all

All Comments (11)

Sign In or Sign Up now to post a comment!
  • what about the better connection between label:for and input:id ?

    i think there is no need to set the req class to both of them.

    ilike this function, i can easily add datatype checking and error handling. good job :)

  • :P

  • Great function, and great video.

  • so just a normal preg thnx

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more