Hope somebody can help me with this, it's been almost a day now and I still can't figure out how to solve this. Right now I have a button that when click opens a jquery modal dialog, inside the dialog there is a twitterbootstrap wizard that works fine. I can click the next and previous button with no problem, now when I try to implement a jquery validation to it as to the example provided in its documentation it is not working. But if I remove the bootstrap wizard from the dialog and put it in a simple page the validation is working. I don't know if I am missing something or something is wrong with my code. Btw I am doing this in asp.net webform page. Please see below for my codes:
Head Section
<link href="bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="prettify.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" type="text/css" />
Body and Jquery Script Section
<form id="form1" runat="server">
<div id="dialog-form" title="Create new user">
<form>
<fieldset>
<div id="rootwizard">
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul>
<li><a href="#tab1" data-toggle="tab">Login Account Information</a></li>
<li><a href="#tab2" data-toggle="tab">Personal Information</a></li>
<li><a href="#tab3" data-toggle="tab">List of Available Subjects</a></li>
</ul>
</div>
</div>
</div>
<div class="tab-content">
<div class="tab-pane" id="tab1">
<asp:TextBox ID="emailfield" runat="server" CssClass="required email"></asp:TextBox>
</div>
<div class="tab-pane" id="tab2">
2
</div>
<div class="tab-pane" id="tab3">
3
</div>
<ul class="pager wizard">
<li class="previous"><a href="#">Previous</a></li>
<li class="next"><a href="#">Next</a></li>
</ul>
</div>
</div>
</fieldset>
</form>
</div>
<asp:Button ID="createuser" runat="server" Text="Button" />
</form>
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script src="bootstrap.min.js" type="text/javascript"></script>
<script src="jquery.bootstrap.wizard.js" type="text/javascript"></script>
<script src="prettify.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
var $validator = $("#form1").validate({
rules: {
emailfield: {
required: true,
email: true,
minlength: 3
}
}
});
$('#rootwizard').bootstrapWizard({
onTabClick: function (tab, navigation, index) {
return false;
},
'onNext': function (tab, navigation, index) {
var $valid = $("#form1").valid();
if (!$valid) {
$validator.focusInvalid();
return false;
}
}
});
window.prettyPrint && prettyPrint()
});
$(function () {
$("#dialog-form").dialog({
autoOpen: false,
height: 500,
width: 980,
modal: true,
resizable: false,
draggable: false
});
$("#createuser")
.button()
.click(function () {
$("#dialog-form").dialog("open");
});
});
</script>
Thanks