【发布时间】:2014-04-12 23:55:14
【问题描述】:
我正在尝试使用单选按钮进行测验,但我不知道如何在单击按钮后发布答案,我添加了一些 cmets,我在代码末尾对此进行了解释。
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
</head>
<body>
<?php
echo "<b> QUIZZZ!!!!! </b> <br>";
echo "----------------------------------------------------------------<br>";
$k=1;
$filmat = array("Horror","Aksion","Komedi","Romance","Thriller","Fantazi");
for ($i=0; $i <=5 ; $i++) {
echo "$k) Do u like {$filmat[$i]} movies?";// willl genearate questions from 1->6
echo "<br>";
echo"<input type='radio' id='butonYes$k'>Yes";// will generate buttons with id from 1->6
echo "<br>";
echo "<input type='radio' id='butonNo$k'> No";$k++;
echo "<br>";
}
echo "----------------------------------------------------------------<br>";
echo "the films u selected are: <br>";
// here i want some jquery or php code to print the question with which genere of movies are clicked
//for exaple i want just to print
/*
Horror
Aksion
Fantazi
*/
// if there are the only ones that are cliked yes
//pls help
?>
</body>
</html>
【问题讨论】:
标签: php jquery html yahoo bing