| | |
does <img tag has disable property
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2006
Posts: 68
Reputation:
Solved Threads: 0
hi all,
i am using an image as a button. so i want to disable it on some actions.
so i used
document.getElementById("imagName").disabled = true;
but it seems that this property is not working for <img
because when i check it with text field by displying an alert
alert(document.getElementById("textField").disabled );
it will alert a boolean value. but when it checked with the image it will alert as "undefined"..
so i want to know that disable property is valid for <img
thanks..
janaka priyadarshana
i am using an image as a button. so i want to disable it on some actions.
so i used
document.getElementById("imagName").disabled = true;
but it seems that this property is not working for <img
because when i check it with text field by displying an alert
alert(document.getElementById("textField").disabled );
it will alert a boolean value. but when it checked with the image it will alert as "undefined"..
so i want to know that disable property is valid for <img
thanks..
janaka priyadarshana
disabled only works on form elements.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
But it is not a form element. A form element is something like <input> <select> and <textarea>.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: Sep 2006
Posts: 68
Reputation:
Solved Threads: 0
but
http://www.java2s.com/Code/JavaScrip...sappliedto.htm
in the above page it is mentioned that dasabled property can be applied for <img
is that wrong...?
http://www.java2s.com/Code/JavaScrip...sappliedto.htm
in the above page it is mentioned that dasabled property can be applied for <img
is that wrong...?
It might be in the specs as being allowed but obviously browsers don't support it.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
If you use:
You should be able to disable it. That's a valid input type; it should be supported widely.
Alterantively; try:
You might have to restyle the button to stop it being drawn as an actual button... but the button will have a disabled property; and disabling the button will stop the image being clicked/prevent the button from being functional.
See: http://www.w3.org/TR/html4/interact/forms.html#h-17.4
HTML and CSS Syntax (Toggle Plain Text)
<input type="image" src="[href to image]"/>
Alterantively; try:
HTML and CSS Syntax (Toggle Plain Text)
<button><img src="[href to image]"/></button>
You might have to restyle the button to stop it being drawn as an actual button... but the button will have a disabled property; and disabling the button will stop the image being clicked/prevent the button from being functional.
See: http://www.w3.org/TR/html4/interact/forms.html#h-17.4
Plato forgot the nullahedron..
i believe you can. add id property and then try and disable. Pls get back to me.
that is
<img src="[href to image]" id="add" name="add" onclick="sendAdd();">
<script lang=javascript>
document.all.add.disabled = true;
</script>
that is
<img src="[href to image]" id="add" name="add" onclick="sendAdd();">
<script lang=javascript>
document.all.add.disabled = true;
</script>
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: renegade footer...Help!!
- Next Thread: Why is this page center aligned?
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash font fonts form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl






