dpepbjp126917 2015-08-16 13:06
浏览 197
已采纳

表单布局和按钮位置

This may be a silly question...

I have a table with a form which has a textarea in one row, on the row beneath is two cells, I want the 'submit' button which will send the input of this textarea on the right cell and a 'clear' button on the cell on the left which will post a different form if clicked. I know we can't have nested forms but is there a way to do this ?

Edited---------------

Here is the code from the table:

<tr>
<td colspan="5" align="left"><form name="confirm" id="confirm" action="order.php" method="post">
<span style="color:#cccccc;">Comments</span><br>
<textarea rows="3" cols="40" name="comments" id="comments"></textarea>
</td>
</tr>


<tr><td align="left" colspan="2">
<input type="hidden" name="tablenumber" value="none">
<input type="hidden" name="action" id="action" value="confirm">
<input type="submit" id="submit" value="CONFIRM" form="confirm" name="submit" class="confirm_btn"></form>
</td>

<td align="right" colspan="3">
<form name="clear" id="clear" action="menu4.php?catid=confirm_order" method="post">
<input type="hidden" name="tablenumber" value="none">

    <input type="hidden" name="action" id="action" value="clear">
    <input type="submit" id="submit" value="CLEAR" form="clear" name="submit" class="clear_btn"></form>&nbsp;
    </td></tr></table>

Yes, the clear button will be sending data, actually is will send a request to emptt the cart and refresh the page.

  • 写回答

1条回答 默认 最新

  • doutouhe5343 2015-08-17 00:59
    关注

    I have worked it out. In HTML5 you can have form elements outside of the element and reference them using form="xxxx" (whatever the id is of the form).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置