我使用Jquery 验证插件来验证下面的这两个输入元素。当输入无效时,插件会在输入字段后立即生成一个标签标签,例如:<label for="company" style="">Required !</label>
问题:如何将错误消息放入现有<span class="help-inline">
而不是生成新的<label>
?
非常感谢您提前提供的帮助。
<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>