单选框按钮,怎么接收页面传递过来的值,并选中啊 单选框按钮,怎么接收页面传递过来的值,并选中啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 纯JSP <%if(request.getAttribute("")==??){ %> 选中 <input type="radio" checked/> <%} %>还可以用标签不自带LZ用什么 可以再写详细点吗?<input type="radio" name="fruit" value = "app">苹果<input type="radio" name="fruit" value = "bra">香蕉<input type="radio" name="fruit" value = "org">橘子 你自己把form的method设置为get,然后看看传递就知道怎么传啦。 这个不是提交,是一个链接,链接到另一个页面<a href="javascript:window.location.href='findPW.jsp?uname='+document.LoginForm2.username.value+'&loginType='+document.LoginForm2.logType.value">忘记密码?</a>新页面用request.getParameter("loginType") 取不到值啊 <script> function getRadioValue(){ var fruits=document.getElementsByName("fruit"); for(var i=0;i<fruits.length;i++){ if(fruits[i].checked) alert(fruits[i].value); } } </script> 用JS,把上页checked的单选按钮的value当做参数传过来 旧页面 <a href="javascript:window.location.href='findPW.jsp?uname='+document.LoginForm2.username.value+'&loginType='+document.LoginForm2.logType.value">忘记密码? </a> 新页面用request.getParameter("loginType") 取不到值啊 <input type="radio" name="fruit" value = "${参数}" checked="${参数}" />checked="true"或"checked"就是选中 false就是不选中 不会吧,LZ的意思是在findPW.jsp用request.getParameter("loginType") 取不到值?我觉得不应该,你在原页面alert看看原页面中取到了吗 原页面我用alert(document.LoginForm2.logType.value);测试了一下,发现原页面得到的值是undefined,那我不明白了 为什么document.LoginForm2.logType.value这句话取不到单选按钮的值呢? req.getParameter("name");然后判断它等于什么 不就可以执行相应的语句了~~ 关于环境变量 有没有人能帮我那这段PHP函数转换成JAVA代码啊 青岛有没有比较好的软件公司 java用虚拟ip发送http请求 输出结果不一样 如何使用JUnit? c/s设想 小數點問題? 给大家提供一段在GUI设计当中,当toolbar太长了如何自动换行的代码 标准化俱乐部,欢迎您的加盟 关于在一个类中调用相同包下的另一个类的问题 这段最简单的代码能改进吗?
<%if(request.getAttribute("")==??){ %>
选中 <input type="radio" checked/>
<%} %>
还可以用标签不自带LZ用什么
<input type="radio" name="fruit" value = "bra">香蕉
<input type="radio" name="fruit" value = "org">橘子
<a href="javascript:window.location.href='findPW.jsp?uname='+document.LoginForm2.username.value+'&loginType='+document.LoginForm2.logType.value">忘记密码?</a>
新页面用request.getParameter("loginType") 取不到值啊
<script>
function getRadioValue(){
var fruits=document.getElementsByName("fruit");
for(var i=0;i<fruits.length;i++){
if(fruits[i].checked)
alert(fruits[i].value);
}
}
</script>
checked="true"或"checked"就是选中 false就是不选中
我觉得不应该,你在原页面alert看看原页面中取到了吗