douyingtai6662 2011-08-09 21:06
浏览 154
已采纳

在表单中使用多个提交按钮

I have a form with two button .I want to redirect to two different pages when i click these button.On the click event of both buttons i am executing a same function.I want that the function should be executed first then it should be redirected to respective page

  • 写回答

2条回答 默认 最新

  • douzhantanju1849 2011-08-09 21:11
    关注

    you could change action of form on the fly during submitting (and answer varies depending on using jquery, pure javascript etc.)

    but I recommend using php for that task

    <input type="submit" value="Edit" class="spare" name="edit">
    <input type="submit" value="Send" class="spare" name="send">
    

    and then:

    if (isset($_POST['edit']))
        ...
    elseif(isset($_POST['send']))
        ...
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器