【发布时间】:2011-08-26 04:23:27
【问题描述】:
$('#err input').bind('blur keyup',function() {
$(this).data('errors', "ABC " + $(this).data('err') + " " + $(this).val());
});
$('#go').click(function(){
var code = "";
$("#err input").each(function(){
code += $(this).data('errors') + "\n" || '';
});
$('#x').html(code);
});
HTML:
<div id="err">
<input data-err="A" id="e-1" type="text"/>
<input data-err="B" id="e-2" type="text"/>
<input data-err="C" id="e-3" type="text"/>
</div>
如何进行验证,如果Input为空,那么这个Input not会被处理?
【问题讨论】:
标签: jquery validation input