Click to See Complete Forum and Search --> : JavaScript/html/textField


toad
12-05-2002, 04:39 PM
can a text field in html be accessed or filled via javascript?

thank you,
toad

gil davis
12-05-2002, 05:19 PM
Yes.

document.formName.textBoxName.value = "whatever"

Rick Bull
12-06-2002, 04:40 AM
Also you can do it via the forms array if you don't want to name your form:


<form id="form1" action=".."><p>
<input name="username" />
<input type="button" onclick="document.forms['form1'].username.value = 'Blah blah blah';" />
</p></form>

toad
12-06-2002, 06:38 PM
Is there any way through javascript to alter info entered in a form submit that is non visual?

Zach Elfers
12-06-2002, 06:55 PM
Do you mean like this?

<input type="hidden" name="hiddenTag">

<input type="button" value="Change Value" onClick="form.hiddenTag.value = 'whatever';">

I'm not sure if that's what you want though.