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

checkbox save results

Status
Not open for further replies.

huobaji

Technical User
Sep 20, 2010
23
US
Thanks in advance

I have a loop that produces checkboxes and results from my variables. Then I build a table to display the results.

I want to make each checkbox to be unigue to each row in the table.

user clicks a button if the checkboxes are checked then some how grab the results from the row. Then I will pass it to another page to save the results.

Does anyone know how to do this

iCrs = 0
For i = 0 to (objLst1.length - 1)

Cs = objLst1.item(i).text
Cn = objLst2.item(i).text
Ct = objLst3.item(i).text
OrgID = objLst4.item(i).text
CG = objLst5.item(i).text
Cc = objLst6.item(i).text

iCrs = iCrs + 1

Response.Write"<tr align=left><td><label><input type=""checkbox"" name=""" &iCrs& """ value=""checkbox""></label></td><td>" & OrgID & " </td><td>" & Ct & " </td><td>" & Cc & " </td><td>" & CG & " </td><td>" & " </tr></td>"
//<td>" & NewTerm & "

Next
 
ASP.NET Forum



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
 
huobaji, If I understand your question, you are trying to grab only the content from each row where the checkbox is selected and then do something with that data on the next page - try this:

Code:
<form action="page2.asp" method="post">
<input type="text" name="tbx_test" value="" /><br />
<% for i = 1 to 5 %>
<input type="checkbox" name="cbx_<%=i%>" value="value<%=i%>-1, value<%=i%>-2, value<%=i%>-3" /> CheckBox <%=i %><br />
<% next %>
<input type="submit" value="Submit">
</form>

Code:
<%
	for each f in request.form
		if left(f,3) = &quot;cbx&quot; then
			response.write request.form(f) &amp; &quot;<br />&quot;
		end if
	next
%>

I included the "textbox" on page1.asp just to show how you can ignore everything but checkboxes on page2.asp....



--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top