Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

OK I have generated a number of textboxes on page load depending on the numer of enterys i have. What i have gotten stuck on is when i submit my form how can i check for my values using a loop? ie: my textboxes or generated tb1,tb2,tb3....etc how can use that in a loop like:

 

Do While i = intEnteryTotal

datafield("item") = tb

Loop

 

 

-----------------------------------------------------------------------------------

Public Function load_desc()

Dim strSQL As String = "SELECT * FROM tblDESCREP"

Dim myConn As New OleDb.OleDbConnection(strProvider)

Dim myDC As New OleDb.OleDbCommand(strSQL, myConn)

myConn.Open()

Dim objRdr As OleDb.OleDbDataReader = myDC.ExecuteReader

 

Dim intI As Integer = 1

Dim intR As Integer

 

Response.Write("<Table><tr><td>Descrepancy Name</td><td align=""center"">Pass</td><td align=""center"">Fail</td><td>Descrepancy Name</td><td align=""center"">Pass</td><td align=""center"">Fail</td></tr><tr>")

Do While objRdr.Read

intR = intI Mod 2

If intR = 1 Then

Response.Write("</tr><tr>")

End If

 

Response.Write("<td style=""WIDTH: 225px"">")

If objRdr.Item("DESCREP_MAJOR") = True Then

Response.Write("<b>")

End If

Response.Write(objRdr.Item("DESCREP_NAME"))

If objRdr.Item("DESCREP_MAJOR") = True Then

Response.Write("</b>")

End If

Response.Write("</td>")

Response.Write("<td style=""WIDTH: 30px"" align=""center""><INPUT Name=""d" & objRdr.Item("DESCREP_ID") & """ type=""radio"" value=""True"" CHECKED></td>")

Response.Write("<td style=""WIDTH: 50px"" align=""center""><INPUT Name=""d" & objRdr.Item("DESCREP_ID") & """ type=""radio"" value=""False""></td>")

intI += 1

 

 

Loop

Response.Write("</tr></Table>")

myConn.Close()

 

End Function

 

-------------------------------------------------------------------------------

Posted

I saw your source, you should be using 'radio button', not 'textbox' right?

 

If you are using radio button, you can use the same name for all radio button, then use "request.form("rdoName")" to get your value for radio button.

 

P/S: If your case are multiple choices, then you should use 'checkbox' rather than radio button

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...