html 表单中submit按钮的禁用问题。 我有一个form表单,里面是checkbox,我想实现当checkbox未被选中时submit按钮是不可用的,当chekbox被选中后,submit变成可用的。请问各位高手怎样实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写个脚本函数,当选中时触发事件让submit=true,否则false <input type="checkbox" name="che" onclick="document.form.b1.disabled=false"><input type="submit" name="b1" disabled="true" value="确定"> <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>New Page 1</title></head><body><form action="" method="post"><input type="checkbox" value="1" name="read" onclick="read1()"/><input type="submit" value=" 提交 " name="submit" disabled /> </form><script language="javascript"> function read1() { (document.all["read"].checked==false)?document.all.submit.disabled=true:document.all.submit.disabled=false; }</script></body></html> <select id="select" onChange="changeButton();"> <option selected>请选择 <option>朝鲜核问题1 <option>朝鲜核问题2 <option>朝鲜核问题3</select><input type="button" id="btn" value="ok" disabled><script>function changeButton(){ var obj=document.getElementById("select"); var btn=document.getElementById("btn"); if(obj.options[obj.selectedIndex].text=="请选择"){ btn.disabled=true; }else{ btn.disabled=false; }}</script> 左导航-->我的技术社区-->我的帖子-->帖子名称行最后的 管理 ?用JavaScript获取父窗口中的option值的问题!(第一次发帖,同时练习给分)(lbx19822004) 200 11 11-3 12:14 管理 ------------------>这里的管理 想问一下hanpoyangtitan(韩波洋)兄弟写的<input type="submit" value=" 提交 " name="submit" disabled /> </form><script language="javascript"> function read1() { (document.all["read"].checked==false)?document.all.submit.disabled=true:document.all.submit.disabled=false; }代码中name="submit"如果改成name="method"这样有什么区别?我的代码是下面这样的,<input type="submit" value=" 提交 " name="method" disabled /> </form><script language="javascript"> function read1() { (document.all["read"].checked==false)?document.all.method.disabled=true:document.all.method.disabled=false; }就不好用了呢?请指点。 求一个java发送邮件的例子!! 向各位真诚求助,遇见的两个问题!! 关于购物系统的问题 中文乱码问题 简单的jsp中文乱码,查了很多文章,还是不行啊 如何用JavaMail发HTML格式的邮件? Tomcat里的DefaultServlet有什么用? tomcat 启动 spring单个定时任务 被调用11次 struts message累加的问题 问一个request.sendRedirect问题 菜鸟问题:web层的action中怎么调用业务层? Mysql 字符集
<input type="submit" name="b1" disabled="true" value="确定">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><body>
<form action="" method="post">
<input type="checkbox" value="1" name="read" onclick="read1()"/>
<input type="submit" value=" 提交 " name="submit" disabled />
</form>
<script language="javascript">
function read1()
{
(document.all["read"].checked==false)?document.all.submit.disabled=true:document.all.submit.disabled=false;
}
</script>
</body></html>
<option selected>请选择
<option>朝鲜核问题1
<option>朝鲜核问题2
<option>朝鲜核问题3
</select>
<input type="button" id="btn" value="ok" disabled>
<script>
function changeButton(){
var obj=document.getElementById("select");
var btn=document.getElementById("btn");
if(obj.options[obj.selectedIndex].text=="请选择"){
btn.disabled=true;
}else{
btn.disabled=false;
}
}
</script>
?用JavaScript获取父窗口中的option值的问题!(第一次发帖,同时练习给分)(lbx19822004) 200 11 11-3 12:14 管理 ------------------>这里的管理
<input type="submit" value=" 提交 " name="submit" disabled />
</form>
<script language="javascript">
function read1()
{
(document.all["read"].checked==false)?document.all.submit.disabled=true:document.all.submit.disabled=false;
}
代码中name="submit"如果改成name="method"这样有什么区别?
我的代码是下面这样的,
<input type="submit" value=" 提交 " name="method" disabled />
</form>
<script language="javascript">
function read1()
{
(document.all["read"].checked==false)?document.all.method.disabled=true:document.all.method.disabled=false;
}
就不好用了呢?请指点。