I have a HTML FORM, inside it,I retrieve multiple records from a table in the database. I populate each record in a row. Each row of the table has a checkbox (its value is the student ID of the record) and a dropdown list that contains 5 different form versions of an exam (A,B,C,D,E). I want the administrator to check the students he wants and choose the form for each student and when click submit button, it updates the form version for the selected students.
Here is a picture that demonstrate my form:
Here is my code which populates the table:
And here is the code when submit the form:
Sometimes, it works perfectly, but sometimes, the value of the submitted form value "up_form" is empty. Anyone know why? Please help me.
Here is a picture that demonstrate my form:

Here is my code which populates the table:
Code:
std_sql = "select ID, SSN, STD_NAME, COLL_DESC, MAJOR_DESC, FORM, CITY, NOTES from kfuban.el_exam_absence" set std_rs = conntemp.execute(std_sql) Dim mrecord_count mrecord_count = 0 DO WHILE NOT std_rs.EOF std_id = std_rs(0) std_ssn = std_rs(1) std_name = std_rs(2) std_coll = std_rs(3) std_major = std_rs(4) std_form = std_rs(5) std_city = std_rs(6) std_notes = std_rs(7) <tr> <td align="center" width="35"><b><input type="checkbox" name="id_chk" value="<%=std_id%>" style="font-weight: 700"></b></td> <td align="center" width="35"><b><%response.write mrecord_count+1%></b></td> <td align="center" width="123"><b><%=std_id%></b></td> <td align="center" width="124"><b><%=std_ssn%></b></td> <td align="center" width="240"><b><%=std_name%></b></td> <td align="center" width="100"><b> <select dir="rtl" name="the_form" style="font-weight: 700"> <option value="" <%if std_form = "" then response.write "selected"%>>Choose Form</option> <option value="A" <%if std_form = "A" then response.write "selected"%>> - A - </option> <option value="B" <%if std_form = "B" then response.write "selected"%>> - B - </option> <option value="C" <%if std_form = "C" then response.write "selected"%>> - C - </option> <option value="D" <%if std_form = "D" then response.write "selected"%>> - D - </option> <option value="E" <%if std_form = "E" then response.write "selected"%>> - E - </option> </select> </td> </tr> <% std_rs.MoveNext mrecord_count = mrecord_count + 1 Loop %>
Code:
for i=1 to Request.form("id_chk").Count ids = Request.form("id_chk")(i) up_form = Request.form("the_form")(i) upSQL="update kfuban.el_exam_absence set FORM = '"&up_form&"' where ID = '"&std_id&"'" set RS=conntemp.execute(upSQL) next
Comment