I recently came across a tutorial on bootstrap validation that caught my eye. It discussed linking email text controls using
data-validation-matches-match="email"
. Additionally, the tutorial mentioned setting min and max values for a group of checkboxes.
Now, imagine I have a group of text boxes within a div named AddressCityCounty
, how can I script it so that all controls in this group turn yellow (similar to the email and Quality Control group in the tutorial) until all fields are filled out?
<div id="AddressCityCounty" style="width:800px;">
<div class="control-group" style="float:left; margin-right:10px;">
<label class="control-label">Address:
<asp:RequiredFieldValidator ID="reqAddress" runat="server" ControlToValidate="txtAddress" CssClass="required" EnableClientScript="true" Display="dynamic" SetFocusOnError="true" ErrorMessage="*"/>
</label>
<div class="controls">
<asp:TextBox ID="txtAddress" runat="server" required/>
<p class="help-block"></p>
</div>
</div>
<div class="control-group""style="float:left; margin-right:10px;">
<label class="control-label">City:
<asp:RequiredFieldValidator ID="reqCity" runat="server" ControlToValidate="txtCity" CssClass="required" EnableClientScript="true" Display="dynamic" SetFocusOnError="true" ErrorMessage="*"/>
</label>
<div class="controls">
<asp:TextBox ID="txtCity" runat="server" required/>
<p class="help-block"></p>
</div>
</div>
<div class="control-group""style="float:left;">
<label class="control-label">County:
<asp:RequiredFieldValidator ID="reqCounty" runat="server" ControlToValidate="txtCounty" CssClass="required" EnableClientScript="true" Display="dynamic" SetFocusOnError="true" ErrorMessage="*"/>
</label>
<div class="controls">
<asp:TextBox ID="txtCounty" runat="server" required/>
<p class="help-block"></p>
</div>
</div>