HTML开发要注意的地方

1.单选框必须是checked,其它都是selected(比如复选框)

<input type='radio' value='$u_id' name='responsable' checked='checked'>

2.disable的text是post不出来的。

3.checkbox,只有被勾上的才能post,否则也不存在

4.多选框要post的时候,这样(直接使用数组):

<select name="good[]" multiple="multiple" id = "select2" style="100px;height:160px;">

<option value='$u_id' selected>$u_id.$job_job</option>

5.多选框里,没有被选中的内容,也不会被提交。

6.只读文字框。注意,只能设置一个value,用来显示和提交。如果不想给人看,直接hidden

<input type="text" name="executer" maxlength="50" size="45" value="<?php echo $user_id ?>" readonly>

<input type="hidden" name="task_id" maxlength="50" size="50" value="<?php echo $id ?>"><br><br>

7. Table增加行间距

<tr>
<td><br><br><br><br></td> <!-- good 加空格很好用,不同数量的br效果也不同 -->
</tr>

但是<tr><br></tr>这样是没用的,只会把<br>放到最抬头的上面去,而不会在table里起作用。

8. POST的时候,input的名字不能带点 .  必须改成下划线 _    例如不能使用 <input style='300' type="text" name="index.desc" value="修改备忘">

9. 如果在同一页面有同名的radio,那么上面的radio是不会被选中的(没有状态)

原文地址:https://www.cnblogs.com/findumars/p/3052592.html