I am looking for a way to disable about 5 or 6 text fields by checking a checkbox. I know that you can do this by this method...
document.orderform.textfield.disabled = true
but I just can't get it to work properly.
What I would like even better is if I could make the fields just appear when the textbox is clicked... like with a invisible div or something... suggestions?
toggling text buttons on and off
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Nope. Disabled. As in, the current state is disabled, not perform the action, disable this control.Jcart wrote:If I'm not mistaken, isn't it disable not disabled?
http://www.w3.org/TR/REC-html40/interac ... ml#h-17.12
nvm... I did this instead...
Code: Select all
function toggleShipping(){
if(document.order.shipping.checked == 1){
document.getElementById("shippinglist").style.visibility = "visible";
document.getElementById("shippinglist").style.height = "auto";
}
else{
document.getElementById("shippinglist").style.visibility = "hidden";
document.getElementById("shippinglist").style.height = "0px";
}
}