Hi all,
I've got a simple function I can't get to work. I've got two checkboxes that are associated with two textarea inputs. I disable the text areas initially. When the associated checkbox is clicked, I want it to enable that text area... and vice versa. Like a toggle.
My form is called pay_form. (The form actually spans several tables, in case that matters). Here's the tag for it:
Here are the two checkboxes:
And here are the two associated textareas:
Finally, here is my function:
Am I doing the parameter passing correctly? How come the textareas aren't toggling on and off? Please help! :) Thanks in advance.
I've got a simple function I can't get to work. I've got two checkboxes that are associated with two textarea inputs. I disable the text areas initially. When the associated checkbox is clicked, I want it to enable that text area... and vice versa. Like a toggle.
My form is called pay_form. (The form actually spans several tables, in case that matters). Here's the tag for it:
Code:
<form ACTION="checkout3.php" method="POST" name="pay_form" id="pay_form" onSubmit="return chkPayForm();" style="margin:0;">
Code:
<input type="checkbox" name="commentbox" id="commentbox" value="0" onClick="msgBox('order_msg');" align="bottom"/>
<input type="checkbox" name="giftbox" id="giftbox" value="0" onClick="msgBox('gift_msg');" align="bottom"/>
Code:
<textarea name="order_msg" id="order_msg" cols="20" rows="3" maxlength="255" disabled></textarea> <textarea name="gift_msg" id="gift_msg" cols="40" rows="3" maxlength="255" disabled></textarea>
Code:
function msgBox(element) {
var frm = document.pay_form;
if (frm.element.disabled == true) {
frm.element.disabled = false;
} else { frm.element.disabled = true; }
}
Comment