hello Robert,
can I set attribute of link by using
document.getElementById("aLink").setAttribute()
if yes, then give me exact function with parameters.....
swati
----- Original Message -----
From: Robert Nyman <robert.nyman@c...>
To: JavaScript HowTo <javascript_howto@p...>
Sent: Wednesday, October 16, 2002 3:31 PM
Subject: [javascript_howto] SV: Re: SV: How to enable/disable link
So change the the input button to a link...
Same code and everything, just:
function
ckVal(oElm){
document.getElementById("aLink").disabled = (oElm.value == "Some
text...")? true : false;
document.getElementById("aLink").onclick = function (){
return (this.disabled)? false : true; // This is
necessary to disable the built-in behavior of the link
}
}
<input type="text" value="Some text..." onChange="checkVal(this)">
<a id="aLink" href="http://www.google.com">A link</a>
BTW, this will only work in IE 5.5.+...
/Robert
-----Ursprungligt meddelande-----
Från: swat [mailto:swati@m...]
Skickat: den 16 oktober 2002 09:25
Till: JavaScript HowTo
Ämne: [javascript_howto] Re: SV: How to enable/disable link
I dont want button..I want link.......
----- Original Message -----
From: Robert Nyman <robert.nyman@c...>
To: JavaScript HowTo <javascript_howto@p...>
Sent: Monday, October 14, 2002 3:23 PM
Subject: [javascript_howto] SV: How to enable/disable link
function checkVal(oElm){
if(oElm.value == "Some text..."){
document.getElementById("submitButton").disabled = true; } else{
document.getElementById("submitButton").disabled = true; } }
(or a neater version of the function:
function checkVal(oElm){
document.getElementById("submitButton").disabled = (oElm.value == "Some
text...")? true : false; }
)
<input type="text" value="Some text..." onChange="checkVal(this)">
<input id="submitButton" name="submitButton" type="submit"
value="Submit">
See also:
http://msdn.microsoft.com/workshop/author/d
html/reference/properties/dis
abled_2.asp
/Robert
-----Ursprungligt meddelande-----
Från: swat [mailto:swati@m...]
Skickat: den 14 oktober 2002 07:10
Till: JavaScript HowTo
Ämne: [javascript_howto] How to enable/disable link
hello,
My query is
How to enable/disable link which is on form when changes in
Textfield?
like u explain enabled/disabled button on form....
reply asap
*********************************************
Great Love And Great Achievements
Involve Great Risk
*********************************************
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20