Basic form using a JQuery Accordion and attempting to validate required fields. Am I missing something simple? Thanks!
javascript:
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$("#accordion").accordion();
$("#Form1").validate({
rules: {
AccordionField: { required: true }
}
});
});
</script>
html:
<form id="Form1" action="foo.htm">
<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<div><p>content</p></div>
<h3><a href="#">Section 2</a></h3>
<div><p><input id="AccordionField" class="required" /></p></div>
</div>
<p><button type="submit">Submit</button></p>
</form>
Problem: If the second section is collapsed during the submit, validation does not validate the required field.