FORM Problem (also posted in javascript).
Hey chaps,
I have a textarea on a web page. I place a button and onclick I call a javascript function to get the value of the textarea, the javascript works. I place a form object around the textarea and the javascript can no longer see the textarea raising "Error: Textareax Undefined"
Any ideas ????? This looks simplistic but I've boiled the whole problem down to the simplest form to try and work out why this is happening...
Cheers.
Chubby..
Re: FORM Problem (also posted in javascript).
Probably how you referenced the object. Try putting formname.objectname and see if that works.
Re: FORM Problem (also posted in javascript).
Quote:
Originally Posted by Ecniv
Probably how you referenced the object. Try putting formname.objectname and see if that works.
Did that, no amount of qualification makes a difference....
Narrowed it down to something within the table around which the form is put. I put another form at the top of the page and it works without a problem... kinda given up, put some hidden fields into the form at the top that an onclick of a button will set from the table's controls and submit....
pain in the a---- but still the page is way too complex to try and debug (a fair bit of DHTML)..
Thanks
Chubby..
Re: FORM Problem (also posted in javascript).
What code did you use in the first place?
You could also try document.getElementById()
Re: FORM Problem (also posted in javascript).
You could do this:
Code:
<script>
function showText(thisForm)
{
alert(thisForm.sometext.value);
}
</script>
<form name="myform">
<textarea name="sometext">Hello!</textarea>
<input type="button" value="click me" onclick="showText(this.form)">
</form>