Tuesday, 15 January 2013

How to validate two text box in jquery using notequal function? -



How to validate two text box in jquery using notequal function? -

i want know, how set validation textbox 2 not equal textbox 1 in jquery?

i trying,

rule:{ textbox1: { required: true } textbox2: { required: true, notequalto: '#textbox1' } }

but not working.

you can assign anonymous function element (let's it'd #textbox2 in case) checking value in previous textbox.

you have this:

$( "#textbox2" ).change(function() { // validation goes here - take value textbox1 , // compare value textbox2 });

here can see little illustration of i'm saying.

jquery

No comments:

Post a Comment