 |
| Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 4th, 2005, 04:31 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
'disabled' image (greyed-out)?
Is there a property to the <img> tag that will allow it to be disabled until a condition is met in the JavaScript? i.e. after a textbox has been filled in the script?
TIA.
Picco
www.crmpicco.co.uk
|
|

October 4th, 2005, 05:22 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
|
|
HI Crmpicco!!
<script>
function check()
{
if(document.myform.mytxt!="")
{
document.myform.img1.disabled=false;
}
}
</script>
<form name=myform method=get action="abc.html">
<img src="go_login1.gif" name=img1 height=100 width=100 disabled onclick="alert('hi')">
<input type=text name=mytxt onchange="check()">
<br>
<br>
<img src="go_login1.gif" height=100 width=100 onclick="alert('hi')">
</form>
Hope this will help you
Cheers :)
vinod
|
|

October 4th, 2005, 08:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thank vinod, that look great
www.crmpicco.co.uk
|
|

October 4th, 2005, 10:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi again vinod, i added the disabled attribute to the <img> tag but it doesnt turn it grey (however it doesn disable it). I suppose i would be able to create a 'grey' image and put some opacity setting on it.
Although, is there a way to make it APPEAR disabled (i.e. grey it out?) like a disabled select drop down?
Thanks
www.crmpicco.co.uk
|
|

October 5th, 2005, 03:07 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks, how easy is it to make a image the same size and structure but grey?
www.crmpicco.co.uk
|
|

October 5th, 2005, 05:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
is it possible to place an image over the top of another without using absolute positioning?
www.crmpicco.co.uk
|
|

October 5th, 2005, 11:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Code:
<style>
.opaque { filter: alpha(opacity=25); -moz-opacity:0.23; opacity=0.25 }
</style>
<img src="images/info_white.gif" id="adt_info1" class="opaque" />
This code works for those that are interested.
Code:
function enableImg()
{
var noa = window.opener.document.form.noa.value;
var noc = window.opener.document.form.noc.value;
for(a=1; a<=noa; a++)
{
var img = window.opener.document.getElementById("adt_info"+a);
img.className = "deopaque";
img.title = "";
img.enablement = "disabled";
img.disabled = false;
}
for(c=1; c<=noc; c++)
{
var ch_img = window.opener.document.getElementById("chd_info"+c);
ch_img.className = "deopaque";
ch_img.title = "";
ch_img.enablement = "disabled";
ch_img.disabled = false;
}
}
i called the above function to make it enabled again.
www.crmpicco.co.uk
|
|

October 6th, 2005, 03:51 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the disabled property seems to work ok, it removes all events from the button
www.crmpicco.co.uk
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Menu Item stays greyed out |
bnsteel |
BOOK: Beginning Mac OS X Programming |
1 |
January 10th, 2008 02:18 PM |
| Disabled icons |
EricJ |
VB How-To |
0 |
July 12th, 2005 09:51 AM |
| disabled popup |
renee_santoscoi |
Javascript How-To |
5 |
November 11th, 2003 02:20 PM |
|
 |