Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i set the contents of a text

Status
Not open for further replies.

minoad

Programmer
Mar 28, 2001
138
US
How do i set the contents of a text box to be a variable outside of a form. The below line is the input that i wish to set the varible to. I have tried document.phone.value, but get an 'object does not support this property error'.

<input type=&quot;text&quot; name=phone>
<input type=&quot;button&quot; name=&quot;button&quot; value=&quot;Submit&quot; onclick=&quot;writefileData()&quot;></td>

Thanks,
Micah A. Norman
 
The only thingI changed when I just tried was I put it inside a form and it worked fine.

Here is my exact code:

<html>
<head>
<title>test</title>
<SCRIPT Language=VBScript>
function writefiledata()
document.test.phone.value = &quot;Hello&quot;
end function
</SCRIPT>

</head>
<body>

<FORM name=test>
<input type=&quot;text&quot; name=phone>
<input type=&quot;button&quot; name=&quot;button&quot; value=&quot;Submit&quot; onclick=&quot;writefileData()&quot;>
</FORM>

</body>
</html>

HTH

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top