PHP表单未发布所有字段
发布时间:2020-12-13 17:16:17 所属栏目:PHP教程 来源:网络整理
导读:我有一个奇怪的问题,我无法理解. 我有以下表格,当我点击提交时,我不会在表格中获取或发布所有字段.只有两个字段被选中 – isnew = true action = object submit = Start form name="newOffer" action="/auth/dashboard" method="post" td?php echo form_hidd
我有一个奇怪的问题,我无法理解.
我有以下表格,当我点击提交时,我不会在表格中获取或发布所有字段.只有两个字段被选中 – isnew = true action = object& submit = Start <form name="newOffer" action="/auth/dashboard" method="post"> <td><?php echo form_hidden('isnew','true');?><?php echo form_hidden('action','object');?><input type="text" id="newOfferItem" placeholder="Offer Free Item" class="input-xlarge"></td> <td><input type="text" id="newOfferText" placeholder="Offer Description" class="input-xlarge" rel="tooltip" title="Description How to get free item"></td> <td><input type="text" id="newOfferFreeOn" placeholder="Stamps for free item" class="input-xlarge" rel="tooltip" title="Number only. Ex. 5"></td> <td><span class="label label-danger">Inactive</span></td> <td><?php $attributes = 'class = "btn btn-success"'; echo form_submit('submit','Start',$attributes);?></td> </form> 解决方法
您需要为每个INPUT元素添加NAME属性 – 代替ID属性或者除ID属性之外还添加NAME属性.
例如 <form name="newOffer" action="/auth/dashboard" method="post"> <td> <?php echo form_hidden('isnew','true');?> <?php echo form_hidden('action','object');?> <input type="text" NAME="newOfferItem" id="newOfferItem" placeholder="Offer Free Item" class="input-xlarge"> </td> <td> <input type="text" NAME="newOfferText" id="newOfferText" placeholder="Offer Description" class="input-xlarge" rel="tooltip" title="Description How to get free item"> </td> <td> <input type="text" NAME="newOfferFreeOn" id="newOfferFreeOn" placeholder="Stamps for free item" class="input-xlarge" rel="tooltip" title="Number only. Ex. 5"> </td> <td> <span class="label label-danger">Inactive</span> </td> <td> <?php $attributes = 'class = "btn btn-success"'; echo form_submit('submit',$attributes);?> </td> </form> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |