禁用/启用icon.gif [英] Disable/enable icon.gif
问题描述
禁用/启用icon.gif
大家好。
我在page.htm中有这个表格:
Disable/enable icon.gif
Hi all.
I have this form in the page.htm:
推荐答案
你需要它作为禁用或隐藏。
问候
Ramanan Kalirajan
Wether u need it as disabled or hidden.
Regards
Ramanan Kalirajan
你需要它作为禁用或隐藏。
问候
Ramanan Kalirajan
Wether u need it as disabled or hidden.
Regards
Ramanan Kalirajan
我需要禁用。
谢谢x你的回复
viki
I need disabled.
thanks x your reply
viki
我需要禁用。
谢谢x你的回复
viki
I need disabled.
thanks x your reply
viki
只需检查,函数中的选定值。为您使用的每个对象提供id。这是一个示例代码
[HTML]< html>
< head>
< script type =" ; text / javascript">
函数doThis()
{
// alert(" hai));
var x = document.getElementById(''mySelect'')。selectedIndex;
alert(document.getElementById(''mySelect'')。options [x] .value);
if(document.getElementById(''mySelect'')。options [x] .value< 1)
document.getElementById(''myImg'')。disabled = true;
}
< / script>
< / head>
< select id = QUOT; mySelect"大小= QUOT; 10" onclick =" doThis()">
< option value =" 0">选择一个值< / option>
< option value = " 1">选择1值< /选项>
<选项值=" 2">选择2值< /选项>
<选项value =" 3">选择3值< /选项>
< / select>
< br />< br />< br />
< img src =" demo.jpg" id =" myImg">
< / html>
[/ HTML]
使用此代码我无法看到图像禁用,同样替换为文本框正在工作。我希望Img不支持禁用属性。而不是禁用你可以使用隐藏属性(我的建议)。
问候
Ramanan Kalirajan
just check, the selected value in the function. Give id to each and every object u use. Here is an example code
[HTML]<html>
<head>
<script type="text/javascript">
function doThis()
{
//alert("hai");
var x = document.getElementById(''mySelect'').selectedIndex;
alert(document.getElementById(''mySelect'').options[x].value);
if(document.getElementById(''mySelect'').options[x].value<1)
document.getElementById(''myImg'').disabled=true;
}
</script>
</head>
<select id="mySelect" size="10" onclick="doThis()">
<option value="0">Select a Value</option>
<option value="1">Select 1 Value</option>
<option value="2">Select 2 Value</option>
<option value="3">Select 3 Value</option>
</select>
<br/><br/><br/>
<img src="demo.jpg" id="myImg">
</html>
[/HTML]
By using this code I cant see the image disabling, same replaced by a text box is working. I hope disable property is not supported for Img. Instead of disabling u can use hidden property (my suggestion).
Regards
Ramanan Kalirajan
这篇关于禁用/启用icon.gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!