判断文本框为空
<form id="form1" name="form1" method="post" action="../contact.aspx">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="line-height: 30px; width: 120px; height: 30px;">
姓名:</td>
<td style="width: 470px; height: 30px;">
<input name="lin_txt_UserName" type="text" class="seo_form_type" id="txt_UserName" size="30" />
<div class="validation-error" id="tip_userName">必须输入</div>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="height: 35px">
<input type="hidden" name="action" value="contact" />
<input type="image" name="imageField" id="imageField" src="../images/enter_Push.gif"/>
</td>
</tr>
</table>
</form>
现在点击type="image"就提交表单,我现在验证里面的文本框不能为空,怎么验证呢??对文本框已经有以下验证需要添加个空验证怎么添加,请高手指教 谢谢
$('#txt_UserName').initValidator({
readyMsg: '必須',
focusMsg: '最少で2字の名前を入力してください',
validMsg: '成功',
msgTarget: 'tip_userName'
}).addValidator('required', {
errorMsg: '入力してください'
}).addValidator('length', {
min: 2,
max: 30,
errorMsg: '名前が短く,最少で2字を入力してください'
});