duanpin2034 2011-07-28 16:15
浏览 114
已采纳

PHP表单 - 如果选择了2个单选按钮

I have a very simple HTML form on a PHP page for a questionnaire.

10 yes/no questions. Radio buttons.

I am trying to figure out how to show a hidden div if any 2 of the radio buttons are set to 'yes'.

would i be better off using a jquery script, or PHP?

  • 写回答

3条回答 默认 最新

  • douyue3800 2011-07-28 16:19
    关注

    PHP could only do it if you roundtrip the form through the server after every button click, which'd still require Javascript to detect the click and submit the form for revamping.

    Remember that PHP runs on the server. By the time the user sees the form and is clicking around on it, PHP has long since completed its job and has shut down.

    In other words, you need to use Javascript for this.

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

报告相同问题?

悬赏问题

  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件
  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果