在JSP页面实现数据提交的问题?
我有一个网页由三个复选框和三个文本框,一一对应。我想实现当我在复选框中打钩时,提交它所对应的文本框中的内容,请问应该如何实现?谢谢!!!
------解决方案-------------------- <!--单击复选框得到Text中的值-->
<script type= "javascript ">
function oc1(){
document.myform.check1.value=document.myform.t1.value;
}
function oc2(){
document.myform.check2.value=document.myform.t2.value;
}
function oc3(){
document.myform.check3.value=document.myform.t3.value;
}
</script>
<form action= " " method= "post " name= "myofrm ">
<input type= "checkbox " name= "check1 " value= " " onclick= "oc1() "/>
<input type= "text " name= "t1 " value= " "/>
<input type= "checkbox " name= "check2 " value= " " onclick= "oc2() "/>
<input type= "text " name= "t2 " value= " "/>
<input type= "checkbox " name= "check3 " value= " " onclick= "oc3() "/>
<input type= "text " name= "t3 " value= " "/>
</form>
你是想选哪个提交哪个,还是直接全是选中状态提交过去啊,这是选中一个得一个值,在后台直接用request.getparameter();就可以得到值了