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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I assign value to a input text variable from another variable

Status
Not open for further replies.

snr

Programmer
Oct 8, 2001
78
US
Hi,
How can I assign value to a input text variable from another input text variable from the same form by onchange function ?

For example :

<table>
<TR>
<td>MY NAME </td>
<input type=&quot;text&quot; name=&quot;iname&quot; onchange=getname(form)> </td>
</TR>
<TR>
<td >MYNAME AGAIN</td>
<input type=&quot;text&quot; name=&quot;iagain&quot;>
</td>
</table>

Whatever &quot;iname&quot; I enter in My Name , I want the same to appear in MYNAME AGAIN ie. in iagain ....

Thanks
 
Use the following for your onchange event. Alternatively, you can include the following statement in your getname function.


onchange=&quot;document.theForm.iagain.value=document.theForm.iname.value;&quot;

Dave Robinder, MCSD
 
Thanks a lot ....
But problem I am facing is the iname is a name of an image file , which is stored in C:\image directory.
How can I show the image ? What shall I write in
<IMG src = *********>
 
Thanks ...
I could do it !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top