Monday, 15 August 2011

jquery validate conflict with toggle function -



jquery validate conflict with toggle function -

i seek validate simple form using jquery validate , within form have 1 checkbox when user click, toggle tr , show input field.

but cannot validate form unless remove toggle checkbox

<input type="checkbox" onclick="popup('#item1','.box1')" id="item1" />tick show

, below toggle function :

function popup(checkbox, box){ $(checkbox).change(function() { $(box).toggle(this.checked); //if checkbox checked show div }).change(); //ensure visible state matches };

and can check jsfiddle

yes seek using jquery.noconflict(); result still same

when implement jquery validation using jquery.validate.js

<script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>

all input type must have name including type="button" avoid jquery conflict, input type trigger function.

jquery jquery-validate

No comments:

Post a Comment