【发布时间】:2012-12-18 23:03:58
【问题描述】:
我想将选定单选按钮的 id 名称和一些 div 元素数据传递到服务器并在服务器端处理这些数据。
例如,下面是我的 CGI 代码。
use strict;
use CGI;
print
"Content-type:text/html\r\n\r\n",
"<html>",
"<body>",
"<div style='float:left'>",
"<input type='radio' name='selections' id='red'>",
"<input type='radio' name='selections' id='blue'>",
"<input type='radio' name='selections' id='green'>",
"</div>",
"<div style='float:left'>",
"<div style='float:left' id='redtime'>red time</div>",
"<div style='float:left' id='blutime'>blue time</div>",
"<div style='float:left' id='greentime'>green time</div>",
"</div>",
"<input type='button' value='clickme'/>",
"</body>",
"</html>";
在上面的 CGI 文件中,我需要传递所选单选按钮的 id 值和任何 div 元素的数据。我如何在 CGI 中做到这一点?
【问题讨论】:
-
您需要阅读一些有关 HTML 表单的内容:w3schools.com/html/html_forms.asp