在同一页面上两个表单提交后台收不到前端提交的数据

迅睿框架 更新 2025-07-21 16:32:52 提莫

一个页面两个表单,表单建立出来之后onclick="dr_ajax_submit<input name="csrf_test_name" type="hidden" value="*****">都一样导致能提交,但是后台接收不到数据,应该怎么办?


方案

  • 迅睿官方创始人 #1 · 2025-07-19 18:01:51
    一个页面来两个form,你的formid号不要写成一样就行了
  • 提莫 #2 · 2025-07-19 19:05:37
    formid没有写成一样的,可以提交。但是后台第二个表单收不到字段信息
  • 迅睿官方创始人 #3 · 2025-07-19 21:00:08
    浏览器开发模式看网络请求记录,看form数据有没有提交上去
  • 提莫 #4 · 2025-07-21 10:25:33
    提交上去是null
  • 小鱼儿 #5 · 2025-07-21 14:11:37
    检查一下提交按钮点击事件上面绑定的formid是不是没改,导致提交的是另一个表单
  • 提莫 #6 · 2025-07-21 14:44:02
    method="post" name="myform" id="contactus" /index.php?s=form&c=contactus&m=post点击事件和formid都写成一样的,会显示
    image
  • 小鱼儿 #7 · 2025-07-21 14:55:45
    name="myform" 这个要不一样,还有下面按钮里面传的这个值也要对应修改
  • 提莫 #8 · 2025-07-21 15:10:22
    <form method="post" name="sgyefrom" id="sgyefrom"> <button type="button" onclick="dr_ajax_submit('域名?s=form&c=sgyefrom&m=post', 'myform', '2000', '域名?s=form&c=sgyefrom&m=post')" ">

    <form method="post" name="contactus" id="contactus">

    <button type="button" onclick="dr_ajax_submit('域名?s=form&c=contactus&m=post', 'myform', '2000', '域名?s=form&c=contactus&m=post')" ">同一个页面上面,两个表单都是用的button。现在这样写都可以提交,但是在后台 name="contactus"这个表单拿不到数据。如果把上面的表单注释了,就可以拿到数据。

  • 迅睿官方创始人 #9 · 2025-07-21 15:48:00

    <form method="post" name="sgyefrom" id="sgyefrom">

    <button type="button" onclick="dr_ajax_submit('域名?s=form&c=sgyefrom&m=post', 'sgyefrom', '2000', '域名?s=form&c=sgyefrom&m=post')" ">


    <form method="post" name="contactus" id="contactus">

    <button type="button" onclick="dr_ajax_submit('域名?s=form&c=contactus&m=post', 'contactus', '2000', '域名?s=form&c=contactus&m=post')" ">

  • 提莫 #10 · 2025-07-21 16:32:52
    谢啦,这次可以了!!! 😂

迅睿系统漏洞

GeoSeo收录宝
GeoSeo收录宝(2026-09-01)
升级 ai智能发布功能 升级 支持8国语言后端设置和前端输出功能 ...
Word发布批量上传
Word发布批量上传(2026-08-31)
版本覆盖问题重发
多语言翻译Seolang
多语言翻译Seolang(2026-08-31)
新增 LLM 大模型对话翻译模块 配置层强类型化重构 URL 模...
自定义存储
自定义存储(2026-08-30)
同步服务器端通用版实现,统一管理端、CMS 端和浏览器直传的提示与错...
GeoSeo工具箱
GeoSeo工具箱(2026-08-29)
新增 bing推送 新增 IndexNow推送 新增 baidu...
外贸多语言建站
外贸多语言建站(2026-08-27)
新增阿里云专业版入口 新增阿里云自动识别字符格式
Querylist渐进式采集
Querylist渐进式采集(2026-08-26)
增加范围截取规则
实时任务
实时任务(2026-08-26)
补充并整理完整使用说明、历史版本更新日志,统一帮助页样式。