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

Populate Textboxes by Clicking Checkbox

Status
Not open for further replies.

stretcher012599

Programmer
Nov 26, 2005
11
0
0
US
My page displays 10 lines of items in my order. I have different quantities for each line item that have been ordered. I also have a empty textbox for each line item. I would like it where if I click a checkbox it fills each textbox with the quantity ordered. I am using Javascript and ASP.
 
Here is my code:

<TABLE class=wrapper cellSpacing=1 cellPadding=2 width="710" border=0>
<TBODY>
<TR>
<TD width="175" noWrap class=title>Serial #</TD>
<TD noWrap class=title><div align="left">Ordered Qty</div></TD>
<TD noWrap class=title><div align="left">Received Qty</div></TD>
<%
if not recordset2.eof then
set SerialNumber = recordset2("SerialNumber")
set POD_Quantity = recordset2("POD_Quantity")
set POD_ReceivedQuantity = recordset2("POD_ReceivedQuantity")
end if
%>
</TR>
<%
DO while not recordset2.EOF
%>
<TD valign="top" class=DataTD><%=SerialNumber%></TD>
<TD valign="top" class=DataTD><%=POD_Quantity%></TD>
<TD valign="top" class=DataTD><input name="POD_ReceivedQuantity" type="text" style="color : #000000; text-align:right; background : #FFFFFF; border-top : 1px solid; border-bottom : 1px solid; border-left : 1px solid; border-right : 1px solid; font-family : Verdana,tahoma,Arial; font-size : 10px;" value="<%=POD_ReceivedQuantity%>" size="11"></TD>
</TR>
<%
recordset2.movenext
loop
%>
</TBODY>
</TABLE>


I loop through the recordset to display each line item. I have POD_Quantity which is the quantity ordered. Then I have POD_ReceivedQuantity which is what the user will be inputting into a textbox next to the quantity ordered.

I would like it so the the user can click a checkbox and it will populate POD_ReceivedQuantity textbox equal to the value of the POD_Quantity field.

So basically I want all the POD_ReceivedQuantity to equal the POD_Quantity fields. I also would like it if the user unchecks the box, all POD_ReceivedQuantity textboxes are set to empty.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top