duanbi8089 2011-05-20 07:19 采纳率: 100%
浏览 47
已采纳

如何只用一个提交按钮提交两个值?

Hey im making a website were you can send other users emails.

My problem is when I go and submit it doesn't submit both values?

my Form has a text box where the user wants to send the email and another is a text area which is the message.

and i don't want 2 submit buttons

  • 写回答

5条回答 默认 最新

  • duan0514324 2011-05-20 09:10
    关注
    <html>
    <head>
    /*... your code here
    ...*/
    </head>
    <body>
    <form name='sampleForm' action='sample.htm' onsubmit='ValidatethisForm()' method="post" enctype="multipart/form-data">
       <input type='text' name='formElem1'>
       <textarea name='formElem2'></textarea>
       <input type = 'submit' value='submit'>
    </form>
    </body>
    
    </html>
    

    In the validate function once u finish your validations use "return true" to proceed. You can submit multiple form elements as long as they have different name attributes and the are within your form tag.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探