<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>
    var i=1;
    function act()
    {
        var s1="您的月收入范围为:";
        var s2="您的职业为:";
        var t="";
        for(i=1;i<=5;i++)
        {
            t="p"+i;
            if(document.getElementById(t).selected==true)
            {
                s1=s1+document.getElementById(t).value+";";
            }
        }

        for(i=0;i<form.work.length;i++)
        {
            if(form.work[i].checked==true)
            {
                 s2=s2+form.work[i].id+","; 
            }
        }
        s1=s1+s2;
        alert(s1);
    }
</script>
<div align="left" style="width:7cm; height:5cm; background-color:#0F6">
<h3 align="center">生活情况调查表</h3>
1.您的月收入范围:
<select name="sel">
    <option value="1000元以下" id="p1" >1000元以下</option>
    <option value="1000-3000元" id="p2">1000-3000元</option>
    <option value="3000-5000元" id="p3">3000-5000元</option>
    <option value="5000-10000元" id="p4">5000-10000元</option>
    <option value="10000元以上" id="p5">10000元以上</option>
</select>
<br/>
2.您的职业:<br/>
<form name="form" action="" method="get">
    <label><input name="work" type="checkbox" value="1" id="程序员"/>程序员</label>
    <label><input name="work" type="checkbox" value="2" id="教师"/>教师</label>
    <label><input name="work" type="checkbox" value="3" id="音乐家"/>音乐家</label>
    <label><input name="work" type="checkbox" value="4" id="演员"/>演员</label>
    <br/>
    <label><input name="work" type="checkbox" value="5" id="模特儿"/>模特儿</label>
    <label><input name="work" type="checkbox" value="6" id="歌手"/>歌手</label>
    <label><input name="work" type="checkbox" value="7" id="售票员"/>售票员</label>
    <label><input name="work" type="checkbox" value="8" id="医生"/>医生</label>
</form>
<br/>
<button name="提交" id="b1" onClick="act()">提交</button>
</div>
</body>
</html>

0
Posted in Java Web

Leave a Comment:

电子邮件地址不会被公开。