解决方案 »
- 在线等 严重: Servlet.service() for servlet default threw exception
- 新手求助啊!
- 如何全库备份db2 利用java代码
- 这个应该怎么做啊???帮帮忙啊!谢谢各位朋友了!!!
- 求助,JSP能否利用脚本对include页面进行无刷新更改
- 如何计算一组数据的标准偏差
- 关于oc4j 9 支持标签
- DWZ Spring MVC BindException求解救
- javabean和ejb(enterprise javabean)有什么区别?在实际的应用中,bean用的多嘛?
- 这样的问题如何解决呀,回答就有分,郁闷,谁来帮我----谢谢先!
- jsp大中型web系统用那种发布比较好?
- hibernate默认值问题
不太会这个,能够帮助我在上面代码基础上完整写下吗?譬如:超链接为www.baidu.com ,谢谢!
<SCRIPT LANGUAGE="JavaScript">
var agree = 0; // 0 means 'no', 1 means 'yes'
function showLink(){
if(agree){
document.getElementById("link").style.display="block";
}else{
document.getElementById("link").style.display="none";
}
}
</script>
</HEAD>
<!-- -->
<BODY>
<center>
<form name=enableform>
You can agree to the terms. (just a demo)<br>
<br>
<input type=radio name='enable' value='agree' onClick="agree=1;">I agree | <input type=radio name='enable' value='disagree' onClick="agree=0;">I disagree<br>
<a href="www.baidu.com" name="link" id="link" style="display:none">www.baidu.com</a>
</form>
<br>
<br>
<input type=submit value="Done!" onclick="showLink();">
</center>
谢谢!基本上是这样,但感觉超链接加在value="Done!"上面会更好些。不要单独显示。
<SCRIPT LANGUAGE="JavaScript">
function done()
{
if(1) //判断条件就不写了,自己写吧
{return true;}
return false;
}
</script>
</HEAD>
<!-- -->
<BODY>
<center>
<form name=enableform action="www.163.com" >
You can agree to the terms. (just a demo)<br>
<br>
<input type=radio name='enable' value='agree' onClick="agree=1; document.enableform.box.focus();">I agree | <input type=radio name='enable' value='disagree' onClick="agree=0; document.enableform.box.value='';">I disagree<br>
<br>
<br>
<input type=submit value="Done!" onclick="return done()">
</form>
</center>
function showLink(){
if(agree) window.location.href="www.baidu.com";
}
谢谢各位哥哥姐姐!问题已经解决。如果触发事件那里不更改的话,我试了下也可以把下面<input type=submit value="Done!" onclick="showLink();">语句改成:
<input type=submit value="Done!" onclick="if(document.enableform.enable[0].checked) location.href='http://www.baidu.com';return false;">再次感谢!