2

I am using Zurb Foundation abide for my form checking. But I am confused of how to add the rule of checking for my personal form input.

For example I have two fields that need to be checked if they are equal.

<form id="myForm">

<input name="pwd" type="password" placeholder="Enter your password">
<input name="pwd2" type="password" placeholder="Enter your password again">

</form>

If they are equal, the form will process to the next step. Else it shows the error message of 'The password must be the same'

Big thanks

zer00ne
  • 41,936
  • 6
  • 41
  • 68
  • Unless your question has something to do with the jQuery Validate plugin, do not use the [tag:jquery-validate] tag. – Sparky Nov 18 '13 at 16:19
  • The zurb foundation abide is using the jQuery for the form checking, i just wanna know is it possible to override that function and make a little correction. – user3005412 Nov 19 '13 at 15:31
  • And tagging questions with things that have nothing to do with its content is highly discouraged. It's called tag-spamming. If you're not sure then read [the tag-wiki](http://stackoverflow.com/questions/tagged/jquery-validate) – Sparky Nov 19 '13 at 15:51

1 Answers1

1

You can use abide's Equal To helper, http://foundation.zurb.com/docs/components/abide.html#equal-to

<form id="myForm">

<input id="pwd" name="pwd" type="password" placeholder="Enter your password">
<input id="pwd2" data-equalto="pwd" name="pwd2" type="password" placeholder="Enter your password again">

</form>
styliii
  • 646
  • 6
  • 13