tp3.2 字段验证

model

tp3.2 字段验证

controller

tp3.2 字段验证

html

<form id="yw0" action="<<$smarty.const.__SELF__>>" method="post"> <table cellpadding="5" cellspacing="3" style="text-align:left; width:100%; border:0;">
<tbody>
<tr>
<td style="width:13%; text-align: right;"><label for="User_username" class="required">用户名
<span class="required">*</span></label>
</td>

<td style="width:87%;">
<input class="inputBg" size="25" name="uname" id="User_username" type="text" value="" />
<span style="color:red;"><<$errorinfo.uname>></span>
</td>
</tr>
<tr>
<td align="right">
<label for="User_password" class="required">密码 <span class="required">*</span></label>
</td>

<td>
<input class="inputBg" size="25" name="upass" id="User_password" type="password" value="" />
<span style="color:red;"><<$errorinfo.upass>></span>
</td>
</tr>
<tr>
<td align="right">
<label for="User_password" class="required">确认密码 <span class="required">*</span></label>
</td>

<td>
<input class="inputBg" size="25" name="rpass" id="User_password" type="password" value="" />
<span style="color:red;"><<$errorinfo.rpass>></span>
</td>
</tr>
<tr>
<!--checkBoxList($model,$attribute,$data,$htmlOptions=array())-->
<td align="right"><label for="User_user_hobby[]">爱好</label></td>

<td>
<input id="User_user_hobby[]_0" value="1" type="checkbox" name="hobby[]" />
<label for="User_user_hobby[]_0">篮球</label>&nbsp;
<input id="User_user_hobby[]_1" value="2" type="checkbox" name="hobby[]" />
<label for="User_user_hobby[]_1">足球</label>&nbsp;
<input id="User_user_hobby[]_2" value="3" type="checkbox" name="hobby[]" />
<label for="User_user_hobby[]_2">排球</label>&nbsp;
<input id="User_user_hobby[]_3" value="4" type="checkbox" name="hobby[]" />
<label for="User_user_hobby[]_3">棒球</label>
</span><span style="color:red;"><<$errorinfo.hobby>></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="left">
<input value="" class="us_Submit_reg" type="submit" />
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</tbody>
</table>

</form>