这是我的表格,它没有传递任何值。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<style type="text/css">
.welcome {
color: #FFFFFF;
text-align: center;
background-color:red;
font-weight:bold;
height: 50px;
}
</style>
<script type="text/javascript">
function submitimg(myvalue)
{
document.getElementById('type').value = myvalue;
document.getElementById('survey').submit();
}
</script>
</head>
<body>
<table style="height: 232px; width: 500px">
<form action="" method="post" name="survey" id="survey">
<tr>
<td>
<div class="welcome"><br>Welcome!</div>
</td>
</tr>
<tr>
<td>
<ul>
<br>
<br>
<div id="question1" style="display: inline;">
<h3>
Are You 30+ Years Old?
</h3>
<div style="height: 10px"> </div>
<input type="button" name="age30" value="Yes" onclick="document.getElementById('question1').style.display='none';document.getElementById('question2').style.display='inline';">
<input type="button" name="age30" value="No" onclick="document.getElementById('question1').style.display='none';document.getElementById('question2').style.display='inline';">
</div>
<div id="question2" style="display: none;">
<h3>
Are You Looking for a Date?
</h3>
<div style="height: 10px"> </div>
<input type="button" name="date" value="Yes" onclick="document.getElementById('question2').style.display='none';document.getElementById('question3').style.display='inline';">
<input type="button" name="date" value="No" onclick="document.getElementById('question2').style.display='none';document.getElementById('question3').style.display='inline';">
</div>
<div id="question3" style="display: none;">
<h3>
Which Girl Is Your Type?
</h3>
<div style="height: 10px"> </div>
<input type="hidden" name="type" value="">
<img src="http://healthystartups.com/storage/600px-MA_Route_1.png?__SQUARESPACE_CACHEVERSION=1319542839834" width="100px" style="cursor:pointer;" onclick="submitimg('type1');">
<img src="http://jenntgrace.com/wp-content/uploads/2012/12/2.png" width="100px" style="cursor:pointer;" onclick="submitimg('type2');">
<img src="http://3.bp.blogspot.com/-Q_owQUxNjdQ/Te3ALCmT3oI/AAAAAAAAAnk/wv9r0b0MT-g/s1600/600px-MA_Route_3.svg_.jpg" width="100px" style="cursor:pointer;" onclick="submitimg('type3');">
<img src="http://4.bp.blogspot.com/-wY_qFr2pcAs/UCxhAayJ6oI/AAAAAAAAC6w/PgtLs2O_4g8/s1600/4.png" width="100px" style="cursor:pointer;" onclick="submitimg('type4');">
</div>
</ul>
</td>
</tr>
</form>
</table>
<?php
$age30 = $_POST['age30'];
$date = $_POST['date'];
$type = $_POST['type'];
echo $_POST['age30'];
?>
</body>
</html>