...

View Full Version : Can anyone figure out what's wrong with this code?



netwarriorgizmo
11-12-2004, 04:20 PM
Hi

I'm trying to use a js function to send an alert method when the user clicks on the command button on a form. For some reason I can't get the code to work (no alert method is triggered). Can anyone see anything obvious? :



}
function setTextArea(form){
alert(form.myarea.value);
}


<b>This section of the form uses a text area.</b><p>
<form name="myform">
<textarea name="myarea" cols="40" rows="5">
Write your comments here.
</textarea>
<p>
<input type="button" name="button3" value="Test TextArea" onClick="See TextArea(this.form)"><br>
<p><p>
</form>


netwarriorgizmo :confused:

Badman3k
11-12-2004, 05:18 PM
It appears u're never even calling the function.

Your onClick should say:

onClick="setTextArea(this.form)"

Oh btw this shouldn't have been posted here, you should have posted it within here (http://www.codingforums.com/forumdisplay.php?f=2), which is the main JavaScript Programming forum.

I think that should solve ur prob.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum