JQuery and form validation
I am using jquery and the form validation plugin from http://bassistance.de/jquery-plugins...in-validation/.
I have a form that accepts credit card payments. I want 1 error message to show up if either the month or the year is not selected. Currently, I have class="required" on both select fields, so 2 error messages will show up.
I cant find much (helpful) documentation on the validation plugin, so if someone knows a way to do this, id appreciate a code snippet.
To validate, I'm simply using:
And my HTML is like so:
<select name="ccxmonth" id="ccxmonth" class="required">
<select name="ccxyear" id="ccxyear" class="required">
Well not familiar with that plug in, but you could use jquery to get the value of the select input using $("#ccxmonth").val(); You'd then add the if/then logic for if the value equals the starting value then throw the error. You'd compare it to the starting value because if it equals that you'd know it hasn't changed. This works as long as your starting value is nothing or "Select a date..." something like that, that isn't a real option.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)