Hi , I hope someone can help me, I think it really should be easy but I don’t know much Javascript. I am trying to make a required field of a text area called “Message”. How can I show required only if the “Yes” button is selected. This is my script:
var x=document.forms[“myForm”][“Message”].value
if (x==null || x==””)
{
alert(“Message” must be filled out”);
return false;
}
<I><B>Include a Card:</p>
<input type=”checkbox” onclick=”SetState(this, myForm.Message)”>Yes<br>
<B><I>Personal Message On Card……….</I></B>
<textarea col=”30″ rows=”10″ name=”Message” disabled>Please write your comments here:</textarea>
Thanks in anticipation.