I have a jquery question about selecting Id.
Basically, I call a javascript function from an onClick function which I pass in control Id and LabelId.
If I use document.getElementById, it will work, however, if I use jQuery selector, it's NOT working.
<script type="text/javascript">
jQuery.noConflict();
function ToggleProgressEnable(valueofRadio, controlId, labelId) {
//Comments: the following will work.
// var control = document.getElementById(controlId);
// var label = document.getElementById(labelId);
//The following is not working.
var control = jQuery("'#" + controlId + "'");
var label = jQuery("'#" + labelId + "'");
if (control != null && label!=null) {
//alert(control.Id);
//alert(control.disabled);
if (valueofRadio == "yes") {
control.disabled = false;
label.disabled = false;
}
else if (valueofRadio == "no") {
control.disabled = true;
control.value = "";
label.disabled = true;
}
//alert(control.disabled);
}
}
</script>