Forms w/ Repeat Region

Forms w/ Repeat Region

Post by john do » Fri, 26 Jan 2001 12:16:05



I am doing a grading system for my students.  In one table, I have a class
list.  I want to input their grades into another table.  I have a form that
pulls up my class roster (using repeat region).  I want to input a grade for
each student, hit submit once and have their grades added to the grades
table - linked by student id.  Is there any way to do this?

Thanks for your help.

 
 
 

Forms w/ Repeat Region

Post by Joe Curr » Fri, 26 Jan 2001 23:12:24


Yes you can, little extra coding

<form>
<select name="Class">
    <option value="English" selected>English</option>
    <option value="Math">Math</option>
</select>

... Assume this is in a table
<repeat region> and this is the repeat region.
    <input type="hidden" name="student_id" Value="Your rsData">
    <select name="grades">
        <option value="A" selected>A</option>
        <option value="B">B</option>
        <option value="C">C</option>
        <option value="D">D</option>
        <option value="F">F</option>
    </select>
<repeat region>
</form>

You will have to post to another file that handles this type of data input
... Code in your file to post to....
<%
'---- Insert Database Connection ------------
set rsInsert = Server.CreateObject("ADODB.Command")
rsInsert.ActiveConnection = "Your Connection"
rsInsert.CommandType = 1
rsInsert.CommandTimeout = 0
rsInsert.Prepared = true
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<%
  Dim i
  Dim A_student_id, A_grade,Class

'if your form items have the same name they will be stored as an array
  A_student_id = Split(Request.Form("student_id"),",")
  A_grade = Split(Request.Form("grade"),",")
  Class = Request.form("Class")

'---- Insert ------------
 for i = 0 to UBOUND(A_STUDENT_ID) - 1
     rsInsert.CommandText = "INSERT INTO YOUR TABLE (STUDENT_ID,GRADE,CLASS)
VALUES (" & A_STUDENT_ID(I) & ", '"& A_GRADE_ID(I) &"','" & CLASS & "' ) "
 rsInsert.Execute()
  Next
%>

I hope this helps.


Quote:> I am doing a grading system for my students.  In one table, I have a class
> list.  I want to input their grades into another table.  I have a form
that
> pulls up my class roster (using repeat region).  I want to input a grade
for
> each student, hit submit once and have their grades added to the grades
> table - linked by student id.  Is there any way to do this?

> Thanks for your help.


 
 
 

1. Nesting Repeat region in the middle of another repeat region

I know how to do a nested repeat region when the nested region is at the end
of the parent repeat region but I have to create a nested region that falls
in the middle of the parent region. For example, I apply a regular repeat
region to the entire table that holds the recordset (5 rows altogether).
Then I select only the 2nd row which I want to be the nested region. Then
from rows 3-5, the parent repeat region continues. I've tried doing it this
way but it only works successfully for the first record. The second record
onward only repeats the parent repeat region and does not process the nested
repeat region.

Any ideas on how to do this either with sql or repeat regions.

I'm using DWmx, Access97 (the above I did in DW UD4 Thomas Muck's nested
repeat region server behaviour)

2. Problems with SAVE AS JPEG image

3. a repeat region within a repeat region

4. Interested in a job in Florida?

5. Repeat Region - Repeat Region -Repeat Region !!!!

6. show streaming for external .swf - loadMovie()

7. Will Repeat region repeat records horizontally than vertically?

8. CSS Selector

9. repeat region but don't repeat...

10. Repeat Region/Hide Region Problem UD1

11. FORMS FORMS FORMS

12. FORMS FORMS FORMS help help help

13. Forms, forms, forms - driving me round the twist!