我们老师出的题目
我写的代码是这样的:
index.jsp
<body>
学生姓名:<input type="text" name="name"></br>
学生年龄:<input type="text" name="age"></br>
学生兴趣
<input type="checkbox" value="sing" name="hobby">唱歌
<input type="checkbox" value="swim" name="hobby">游泳
<input type="checkbox" value="read" name="hobby">看书
<input type="checkbox" value="internet" name="hobby">上网
<form action = "show.jsp"><input type="submit" value="提交"></form>
<br>
</body>
然后show.jsp就不知道怎么写了 剩下的都不会做
我写的代码是这样的:
index.jsp
<body>
学生姓名:<input type="text" name="name"></br>
学生年龄:<input type="text" name="age"></br>
学生兴趣
<input type="checkbox" value="sing" name="hobby">唱歌
<input type="checkbox" value="swim" name="hobby">游泳
<input type="checkbox" value="read" name="hobby">看书
<input type="checkbox" value="internet" name="hobby">上网
<form action = "show.jsp"><input type="submit" value="提交"></form>
<br>
</body>
然后show.jsp就不知道怎么写了 剩下的都不会做
<script language="javascript" type="text/javascript">
window.location.href="show.jsp?name="+ document.getElementById("name").value;
</script>
<form action="">
<input/>
<input/>
<input/>
<input/>
<input type="submit">
</form>这样后台才能得到;