I use Jquery validation plug-in to validate these two input elements below.
When an input is invalid the plug-in will generate a label tag right after the input field, such as: <label for="company" style="">Required !</label>
Question:
How do I put the error message in the existed <span class="help-inline"> instead of generating a new <label> ?
Many thanks for your help in advance.
<script type="text/javascript">
$('#signUpForm').validate({
debug: false,
rules: {company:"required",username:"required"},
messages: {company:"Required !",username:"Required !"}
})// End of validate()
</script>
<div class="control-group">
<label class="control-label" for="company">Company Name</label>
<div class="controls">
<input type="text" name="company">
<label for="company">Required !</label> // -> this line is generated by Plug-In.
<span class="help-inline">(required)</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="username">User Name</label>
<div class="controls">
<input type="text" name="username">
<span class="help-inline">(required)</span>
</div>
</div>