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

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?

图片转代码服务由CSDN问答提供 功能建议

我在PHP页面上有一个非常简单的HTML表单,用于问卷调查。 < p> 10是/否问题。 单选按钮。

如果任何2个单选按钮设置为“是”,我试图弄清楚如何显示隐藏的div。

我会更好地使用jquery脚本,还是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条)

相关推荐 更多相似问题