php页面中,
原代码如下:
<div>
<input name="lp" type="checkbox" style="margin-bottom:-1px;" value="1"> a
</div>
<div>
<input name="esf" type="checkbox" style="margin-bottom:-1px;" value="1"> b
</div>
<div>
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="1"> 1
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="2"> 2
</div>刚进页面时,最后一排的条件是不可用的,复选框和文字都要为灰色,点击了上面的a和b中的任何一项后,这一排变为可用
这如何实现呀,thanks
原代码如下:
<div>
<input name="lp" type="checkbox" style="margin-bottom:-1px;" value="1"> a
</div>
<div>
<input name="esf" type="checkbox" style="margin-bottom:-1px;" value="1"> b
</div>
<div>
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="1"> 1
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="2"> 2
</div>刚进页面时,最后一排的条件是不可用的,复选框和文字都要为灰色,点击了上面的a和b中的任何一项后,这一排变为可用
这如何实现呀,thanks
解决方案 »
- php怎么循环输出评论与回复 mysql表结构是否有问题
- 声音提示问题 急 高手帮帮忙
- 如何输出URL里传来的变量$id如 tool.php?info=200@qq@帐号$id
- 求教个问题,关于URL的。
- php怎么取得上面列表框中所有的值啊
- 如何在cookie不能用的情况下进行限时操作
- 请问如何设置mysql的用户权限?
- 关于PHP连接mysql的总是
- 关于PHP中查询问题请帮我解答加50分
- 微信小程序后台用php怎么写原生sql
- 关于自定义函数在哪里执行的问题
- foreach from=$default_products item=product name=myLoop 这个语句怎么理解?
<input name="lp" type="checkbox" style="margin-bottom:-1px;" value="1"> a
</div>
<div>
<input name="esf" type="checkbox" style="margin-bottom:-1px;" value="1"> b
</div>
<div>
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="1" disabled> 1
<input name="price[]" type="checkbox" style="margin-bottom:-1px;" value="2" disabled> 2
</div>
根据你要的条件决定是不是要加disable属性
这样设置为何没有用呢,大家帮我看下
这个出来的是一个数组
要用document.getElementsByName("price")[0]
document.getElementsByName("price")[1]
document.getElementsByName("price[]")[1].disabled=false;你应该在循环里做这类设置var el = document.getElementsByName("price[]");
for(i=0; i<el.length; i++)
el[i].disabled = false;