我正在使用 JQUery 工具 -验证错误摘要
/* adds an effect called "wall" to the validator */
$.tools.validator.addEffect("wall", function(errors, event) {
// get the message wall
var wall = $(this.getConf().container).fadeIn();
// remove all existing messages
wall.find("p").remove();
// add new ones
$.each(errors, function(index, error) {
wall.append(
"<p><strong>" +error.input.attr("name")+ "</strong> " +error.messages[0]+ "</p>"
);
});
// the effect does nothing when all inputs are valid
}, function(inputs) {
});
如果您可以看到图像一切正常,我想要的是,通过更改此代码,而不是文本框名称,我希望在错误消息之前显示标签文本。
提前致谢。 编辑:HTML
<tbody style="" class="user_panel" id="customer_info">
<tr>
<td valign="top"><label class="label">Contact name:</label>
<input type="text" value="" name="contact_name" class="" style="width:227px"></td>
<td> </td>
</tr>
<tr>
<td valign="top"><label class="label">Measurement:</label>
<select value="" data-message="Measurement is required1" required="required" name="measurement" style="width: 231px; border-color: red;">
<option value="">-select-</option>
<option value="1">mm</option>
<option value="2">inches</option>
</select></td>
<td> </td>
</tr>
<tr>
<td valign="top"><label class="label">Phone personal:</label>
<input type="text" value="" data-message="Pers cont. num is required" required="required" name="contact_number_person" class="" style="width: 227px; border-color: red;"></td>
<td> </td>
</tr>
<tr>