带有asp验证程序的jquery多步骤表单
我正在尝试使用字段集在jquery中创建一个多步骤注册表单。在fieldset中,我有多个带有asp验证程序的文本框。那么,我应该怎么做,以便每当验证器发出错误消息时,字段集不应该移动到下一个字段集 以下是我的JavaScript:带有asp验证程序的jquery多步骤表单,jquery,asp.net,Jquery,Asp.net,我正在尝试使用字段集在jquery中创建一个多步骤注册表单。在fieldset中,我有多个带有asp验证程序的文本框。那么,我应该怎么做,以便每当验证器发出错误消息时,字段集不应该移动到下一个字段集 以下是我的JavaScript: $(document).ready(function(){ $(".next_btn").click(function(){ //Function runs on NEXT button click $
$(document).ready(function(){
$(".next_btn").click(function(){ //Function runs on NEXT button click
$(this).parent().next().fadeIn('slow');
$(this).parent().css({ 'display': 'none' });
//Adding class active to show steps forward;
$('.activereg').next().addClass('activereg');
});
$(".pre_btn").click(function(){ //Function runs on PREVIOUS button click
$(this).parent().prev().fadeIn('slow');
$(this).parent().css({'display':'none'});
//Removing class active to show steps backward;
$('.activereg:last').removeClass('activereg');
});
});
还有我的aspx页面
<fieldset id="first" >
<table style="vertical-align: text-top; text-align: left; width:950px" >
<tr>
<td style="width: 100px; text-align: left">
<asp:Label ID="Label2" runat="server" Text="Enrollment ID" Font-Bold="True"></asp:Label></td>
<td style="width: 141px">
<asp:TextBox ID="TextBox2" runat="server" Width="240px" MaxLength="10" ></asp:TextBox></td>
<td>
<asp:RequiredFieldValidator ID="rfvTxtB2" runat="server" ControlToValidate="TextBox2" ValidationGroup="Validation1" Text="*" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="revEnrollNo" runat="server" ValidationExpression="^[0-9 ]+$"
ControlToValidate="TextBox2" ErrorMessage="Enter Valid Enrollment ID" Display="Dynamic" ValidationGroup="Validation1" EnableClientScript="true"/>
<td>
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<!--More textboxes and validators like above-->
<input type="button" id="btn1" name="next" class="next_btn" value="Next" ValidationGroup="Validation1"/>
</fieldset>
与您的问题本身无关,但代码块末尾的句点行是怎么回事?这应该是存在的吗?不。有了这些点,我想说我的代码中有更多的文本框和验证器,就像上面所说的那样。啊-我看不太清楚。我建议用一个HTML注释来替换它们,该注释明确说明了这一点。