PDA

View Full Version : 'Object doesn't support this property or method'


bacterozoid
07-19-2002, 10:55 PM
Ok, well I have been dinking around with my big new JavaScript book (JavaScript Bible 4th ed.) and I am around to objects and methods (Which I do know a bit about because I have been troubleshooting and manipulating other JavaScript scripts before) and don't know
1. if it is even possible, and
2. if so, how to do it.

Code:

<form NAME="clickme">
<input type="button" value="Write Text" name="button" onClick="one()"></p>
</form>
<script language="javascript">
function one()
{
document.form.formbox.write('Hi!')
}
</script>
<form name="form">
<textarea rows="2" cols="20" name="formbox"></textarea>
</form>


As you can see, clicking on the button tells it to run function one() which I am trying to get to write text into the textarea. Any way this can be accomplished?

Thanks.

caldasgsm
07-20-2002, 12:01 AM
<form NAME="clickme">
<input type="button" value="Write Text" name="button" onClick="one()"></p>
</form>
<script language="javascript">
function one()
{
document.form.formbox.value = 'Hi!';
}
</script>
<form name="form">
<textarea rows="2" cols="20" name="formbox"></textarea>
</form>

bacterozoid
07-20-2002, 12:04 AM
well i took off the [b] things and got rid of the semicolon around thereabouts and it does what i want to. the .value part i had tried, but i also used parenthesies with it, so that must have been why it didn't work.

thanks!