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

Help in outputting value of a textfield within a table

Status
Not open for further replies.

miks

MIS
Sep 27, 2002
13
CH
Hi guys! Is there a way to output the value of textfield 'text1' in table 'listTable' to a cell in table 'listTable2' ? Any help is appreciated...THANKS! Below is the code fragments...


<body bgcolor=&quot;#FFFFFF&quot;>
<form name=&quot;a&quot;>
<table name=&quot;listTable&quot; id=&quot;listTable&quot; width=&quot;98%&quot; border=&quot;0&quot;>
<tr>
<td colspan=&quot;3&quot;>
<div align=&quot;center&quot;><b>MAINTAIN CLIENT</b></div>
</td>
</tr>
<tr>
<td width=&quot;14%&quot;></td>
<td width=&quot;62%&quot;></td>
<td width=&quot;24%&quot;></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client No.</b></td>
<td width=&quot;62%&quot;><b>
<input type=&quot;text&quot; name=&quot;text1&quot; size=&quot;15&quot;>
</b></td>
<td width=&quot;24%&quot;><b> </b></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client Name</b></td>
<td width=&quot;62%&quot;><b>
<input type=&quot;text&quot; name=&quot;text2&quot; size=&quot;40&quot;>
</b></td>
</tr>
</table>

<table name=&quot;listTable2&quot; id=&quot;listTable2&quot; width=&quot;98%&quot; border=&quot;0&quot;>
<tr>
<td colspan=&quot;3&quot;>
<div align=&quot;center&quot;><b>MAINTAIN CLIENT</b></div>
</td>
</tr>
<tr>
<td width=&quot;14%&quot;></td>
<td width=&quot;62%&quot;></td>
<td width=&quot;24%&quot;></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client No.</b></td>
<td width=&quot;62%&quot;><b>
<td> document.a.listTable.text1.value </td>
<!input type=&quot;text&quot; name=&quot;text1&quot; size=&quot;15&quot;>
</b></td>
<td width=&quot;24%&quot;><b> </b></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client Name</b></td>
<td width=&quot;62%&quot;><b>
<!input type=&quot;text&quot; name=&quot;text2&quot; size=&quot;40&quot;>
</b></td>
</tr>
</table>

<input type=button value=Print onClick=&quot;rewrite(this.form)&quot;>
</form>
 
Hi,
I made a couple of changes to your code and I think the value of text1 will now be printed out in the second table. I don't think you need the exclamation point inside the <input> tag. I also saw there were 2 text1 boxes so I re-named the boxes so they would all have unique names. Then, I put your code to write out the value of text1 inside <script> tags. See if this is what you want and if not, just post another and I'll see what I can do.

Good luck!
S-)
Julie

<body bgcolor=&quot;#FFFFFF&quot;>
<form name=&quot;a&quot;>
<table name=&quot;listTable&quot; id=&quot;listTable&quot; width=&quot;98%&quot; border=&quot;0&quot;>
<tr>
<td colspan=&quot;3&quot;>
<div align=&quot;center&quot;><b>MAINTAIN CLIENT</b></div>
</td>
</tr>
<tr>
<td width=&quot;14%&quot;></td>
<td width=&quot;62%&quot;></td>
<td width=&quot;24%&quot;></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client No.</b></td>
<td width=&quot;62%&quot;><b>
<input type=&quot;text&quot; name=&quot;text1&quot; size=&quot;15&quot; value = &quot;testing...&quot;>
</b></td>
<td width=&quot;24%&quot;><b> </b></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client Name</b></td>
<td width=&quot;62%&quot;><b>
<input type=&quot;text&quot; name=&quot;text2&quot; size=&quot;40&quot;>
</b></td>
</tr>
</table>

<table name=&quot;listTable2&quot; id=&quot;listTable2&quot; width=&quot;98%&quot; border=&quot;0&quot;>
<tr>
<td colspan=&quot;3&quot;>
<div align=&quot;center&quot;><b>MAINTAIN CLIENT</b></div>
</td>
</tr>
<tr>
<td width=&quot;14%&quot;></td>
<td width=&quot;62%&quot;></td>
<td width=&quot;24%&quot;></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client No.</b></td>
<td width=&quot;62%&quot;><b>
<td>
<SCRIPT LANGUAGE=javascript>
<!--
document.write(document.a.text1.value);
//-->
</SCRIPT>
</td>
<input type=&quot;text&quot; name=&quot;text2&quot; size=&quot;15&quot;>
</b></td>
<td width=&quot;24%&quot;><b> </b></td>
</tr>
<tr>
<td width=&quot;14%&quot;><b>Client Name</b></td>
<td width=&quot;62%&quot;><b>
<input type=&quot;text&quot; name=&quot;text3&quot; size=&quot;40&quot;>
</b></td>
</tr>
</table>

<input type=button value=Print onClick=&quot;rewrite(this.form)&quot;>
</form>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top