There are 2 radiobutton and a hyperlink. if select 'radiobutton1' the hyperlink is enabled. if select 'radiobutton2' the hyperlink is disabled. i can use jquery to disable the hyperlink, but can't enable it. How to enable the hyperlink with jquery?
+2
A:
You could try adding a click event handler and return true or false from the click handler based on the state of the radio buttons.
Returning false should cancel the click on the link, something like:
$("#hyperlink1").click(function(){
// return true or false based on your radio buttons
return enableLink;
});
seanb
2008-12-11 08:04:22
A:
To disable hyperlink you could add onclick handler to it returning false;
something like this:
$("#radioDisable").click(function() {
$(“hyperlink”).click(function(){
return false;
});
$(“hyperlink”).addClass(“disabled”);
});
$("#radioEnable").click(function() {
$(“hyperlink”).click(function(){
return true;
});
$(“hyperlink”).removeClass(“disabled”);
});
miceuz
2008-12-11 09:28:31
A:
The 'disabled' property can be get and set. This property is for individual objects though and not for sets of objects.
if (!$("#ContinueButton")[0].disabled) {
UserContinue();
}
write:
$("#ContinueButton")[0].disabled = !canContinue;
Frank Schwieterman
2009-01-04 21:34:38