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

Passing checkbox values to stored procedure contd.

Status
Not open for further replies.

rmagan

Programmer
Jun 3, 2003
35
US
Here is a sample of my code. The checkbox ('p_drop_class') is the last item in the table. This example only has 1 row, but a real table would have more rows.



<form name=&quot;maint_student_schedule&quot; action=&quot;stars3.star_portal.process_student_schedule&quot; method=&quot;post&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=0 cellpadding=2 id=&quot;student_schedule&quot;>
<thead>
<tr>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Period</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Sem</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Class-Sec</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Name</font></th>

<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Room</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Days</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Teacher</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Status</font></th>
<th BGCOLOR=&quot;#000063&quot; nowrap align=&quot;left&quot;><font CLASS=&quot;PortletText1&quot; COLOR=&quot;WHITE&quot;>Drop</font></th>
</tr>
</thead
<TBODY>
<input type=&quot;hidden&quot; name=&quot;p_start_yy&quot; value=03>
<input type=&quot;hidden&quot; name=&quot;p_school&quot; value=KAF>
<input type=&quot;hidden&quot; name=&quot;p_student_id&quot; value=A013>
<tr>
<td>01&nbsp (07:00-08:44)</td>
<td>FY</td>
<td>112-001</td>
<td>ENGLISH 10</td>
<td>100</td>
<td>MTWRF</td>
<td><a HREF=&quot;mailto:001@SOMEWHERE.COM&quot;>FRANK, COSTNER</a></td>
<td><a HREF=&quot;STARS3.STUDENT_CLASS_ATT_DET.show?p_arg_names=_show_header&p_arg_values=YES&p_arg_names=_max_rows&p_arg_values=20&p_arg_names=_portal_max_rows&p_arg_values=20&p_arg_names=start_yy&p_arg_values=03&p_arg_names=school&p_arg_values=KAF&p_arg_names=student_id&p_arg_values=A013&p_arg_names=class_cd&p_arg_values=112&p_arg_names=section&p_arg_values=001&p_arg_names=period&p_arg_values=01&quot; TARGET=&quot;student_class_att_det_window&quot;>Present</a></td>
<input type=&quot;hidden&quot; name=&quot;p_class_cd&quot; value=112>
<input type=&quot;hidden&quot; name=&quot;p_section&quot; value=001>
<td><input type=&quot;checkbox&quot; name=&quot;p_drop_class&quot;></td>
<tr>
</tbody>
</form>
</table>
 
I'm assuming from your snippet of code above that all your checkboxes are going to be named p_drop_class, so if you wanna pass an &quot;on&quot; or &quot;off&quot; value for each one, do something like this:

Code:
function captureOffices() {
   var list = formname.p_drop_class;
   for(var i = 0; i < list.length; i++) {
      if(list[i].checked) {
         //pass value &quot;on&quot;
      }
      else {
         //pass value &quot;off&quot;
      }
   }
}

You could, if you wanted, build an array of &quot;on&quot; and &quot;off&quot; values to correspond with the checkboxes and then send them that way. I'm sure there's plenty of different ways you could do it.


-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top