<body>
<p>Tell Me About Yourself</p>
<br>
<form action="/action_page.php">
What is Your Name? <input type="text" name="name">
<br>
How old are you? <input type="text" name="old">
<br>
<p>What are your favorite subjects?</p>
<select name="subjects" size="3" multiple="multiple">
<option value="Math">Math</option>
<option value="Science">Science</option>
<option value="English">English</option>
<option value="History">History</option>
<option value="Art">Art</option>
<option value="Music">Music</option>
<option value="Social Studies">Social Studies</option>
<option value="Physics">Physics</option>
<option value="Chemistry">Chemistry</option>
<option value="Biology">Biology</option>
</select>
<form action=""method="get">
<p>Are you a boy ot a girl?</p>
<br>
<input type="radio"name="gender"value="girl"/>a girl
<input type="radio"name="gender"value="boy"/>a boy
<p>About My Web Site</p>
<form action=""method="get">
<p>What were your favorite pages?</p>
<input type="checkbox"name="page"value="home"/>Home
<input type="checkbox"name="page"value="about"/>About
<input type="checkbox"name="page"value="school"/>School
<input type="checkbox"name="page"value="hobbies"/>Hobbies
</p>
</form>
<form action=""mathod="get">
<p>please leave comment</p>
<textarea name="comments"/></textarea>
<p>
</form>
<input type="submit">
<input type="reset">
</body>
</html>
一个简单的调查问卷,望采纳
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />
<title>在线调查</title>
<script language="javascript">
function GetSelectedEffect(effects)
{
var i
for(i=0i<effects.lengthi++)
{
if(effects[i].checked) return effects[i].value
}
return"[没有选择]"
}
function GetSelectedPrograms(programs)
{
var i,result=""
for(i=0i<programs.lengthi++)
{
if(programs[i].checked) result+="["+programs[i].value+"]"
}
return result
}
function ShowResult()
{
var f,msg
f=document.myform
msg="您感觉本站:"+GetSelectedEffect(f.page_effect)
msg+="\n您希望本站出现以下栏目:"+GetSelectedPrograms(f.program)
alert(msg)
}
</script>
</head>
<body>
<table width="400">
<tr>
<td align="center">
<h2>在线调查</h2>
<p>您感觉本站的主页效果如何(单选):</p>
<form name="myform">
<p><input type="radio" value="非常好" name="page_effect" checked>非常好
<input type="radio" value="好" name="page_effect">好
<input type="radio" value="一般" name="page_effect" >一般
</p>
<p>您希望本站出现以下什么栏目(多选):</p>
<p><input type="checkbox" name="program" value="新闻">新闻
<input type="checkbox" name="program" value="娱乐">娱乐
<input type="checkbox" name="program" value="教育">教育
</p>
<p><input type="button" name="bl" value="提交" onClick="ShowResult()"></p>
</form>
</td></tr>
</table>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)