How would I validate the “Third Step” on my multi-stage jQuery form?
It can be found here: http://jsfiddle.net/methuselah/xSkgH/22/
I want to prevent the user from going onto the next step without entering a value so ideally an error message would pop up if they try.
So far the field is readonly so the user cannot edit any entries but this alone doesn’t prevent the user from completely skipping the step and carrying on.
Thanks in advance!
You can just check if
$('#datepicker').val()is falsy in case you are sure your datepicker will always insert valid values:See: http://jsfiddle.net/xSkgH/28/
In case this gets a little more complex some time soon you might want to look at the jQuery validation plugin that many people use.