M
Mamun
Hi All,
I have the following case.
I am trying to update a table based on the value of dropdown box and
checkbox.
Here is what I have in page1.asp
<table>
<tr>
<td>STATUS</td>
<td>Claim Number</td>
<td>Select</td>
</tr>
<form name=form action='Page2.asp' method='post'>
<%dim I : I=1
do while not rs.EOF%>
<tr>
<td>
<select name="selStatus">
<option value="A" selected>A</option>
<option value='P'>P</option>
<option value='D'>D</option>
</select>
</td>
<td><%=rs("Claim_Number")%></td>
<td><input type='checkbox' name='chk<%=i%>'
value='<%=rs("Claim_Number")%>'></td>
</tr>
<%rs.MoveNext
I = I + 1
Loop
%>
<tr align='center' bgcolor='white'>
<td><input type="submit" value="Submit" name="cmdSubmit">
<input type='hidden' name='No_of_Records' value='<%=I%>'>
</td>
</tr>
</form>
</table>
Now in page2.asp, I need to update data based on which checkbox was
checked and what was selected in the STATUS field
which is A, P and D.
I have the following code in page2.asp:
if Len(Request.Form("cmdSubmit"))>0 then
dim JJ
dim N
f_Records, strClaimID, strStatusCD
N
f_Records=Request.Form("No_of_Records")
For JJ=0 to N
f_Records-1
if Request.Form("chk" & JJ)<>"" then
strClaimID=Request.Form("chk" & JJ)
qry="Update warx065_srs set VENSTATCDE='" & strStatusCD & "' where
ClaimNumber='" & strClaimID & "'"
Conn.Execute(qry)
end if
Next
end if
The code in page2.asp selects the right claim Number but not the right
status.
For ex. if I check 2 checkboxes and run the query I get the following:
Update table1 set VENSTATCDE='A, A, D, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A' where ClaimNumber='K90611'
Update table1 set VENSTATCDE='A, A, D, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A' where ClaimNumber='K93632'
I have 50 records in each page.
How can I associate the value of dropdown with checkbox in this case.
I would highly appreciate your help.
Thanks a lmillion in advance.
best regards,
mamun
I have the following case.
I am trying to update a table based on the value of dropdown box and
checkbox.
Here is what I have in page1.asp
<table>
<tr>
<td>STATUS</td>
<td>Claim Number</td>
<td>Select</td>
</tr>
<form name=form action='Page2.asp' method='post'>
<%dim I : I=1
do while not rs.EOF%>
<tr>
<td>
<select name="selStatus">
<option value="A" selected>A</option>
<option value='P'>P</option>
<option value='D'>D</option>
</select>
</td>
<td><%=rs("Claim_Number")%></td>
<td><input type='checkbox' name='chk<%=i%>'
value='<%=rs("Claim_Number")%>'></td>
</tr>
<%rs.MoveNext
I = I + 1
Loop
%>
<tr align='center' bgcolor='white'>
<td><input type="submit" value="Submit" name="cmdSubmit">
<input type='hidden' name='No_of_Records' value='<%=I%>'>
</td>
</tr>
</form>
</table>
Now in page2.asp, I need to update data based on which checkbox was
checked and what was selected in the STATUS field
which is A, P and D.
I have the following code in page2.asp:
if Len(Request.Form("cmdSubmit"))>0 then
dim JJ
dim N
N
For JJ=0 to N
if Request.Form("chk" & JJ)<>"" then
strClaimID=Request.Form("chk" & JJ)
qry="Update warx065_srs set VENSTATCDE='" & strStatusCD & "' where
ClaimNumber='" & strClaimID & "'"
Conn.Execute(qry)
end if
Next
end if
The code in page2.asp selects the right claim Number but not the right
status.
For ex. if I check 2 checkboxes and run the query I get the following:
Update table1 set VENSTATCDE='A, A, D, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A' where ClaimNumber='K90611'
Update table1 set VENSTATCDE='A, A, D, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
A, A, A, A, A, A, A, A, A, A, A, A, A, A' where ClaimNumber='K93632'
I have 50 records in each page.
How can I associate the value of dropdown with checkbox in this case.
I would highly appreciate your help.
Thanks a lmillion in advance.
best regards,
mamun