Just Normalized table, but confused on how to enter joined data properly.

dealio

Member
I'm trying to normalize the way my data is stored but having problem getting the date into the table the correctly.

The repeat group great, but maybe someone could point me in the right direction for specifying the row data for the repeat groups. For example:


I had my original 2 tables:
==============================

"Report_table"
---------------------
report_no | id
---------------------
123 | 1


"People_Table" (i know this wasn't right to do it.)
-------------------------------------------------------------------------------
report_id | teacher_name | student_name1 | student_name2 |student1grade | studen2grade
1 teacher1 Name1 Name2 6 7




I then change the "People_Table" to be more normalized
================================================

"People_Table"
-------------------------------------------------
report | name | grade | PersonType
-------------------------------------------------
1 | teacher1 | n/a | teacher
2 | student1 | 6 | student
3 | student2 | 7 | student



Here is where I'm stuck:

How do I configure the form to enter the "PersonType" field data. What the proper way to specify what to enter for the teacher type record vs student type record. For Example:


Here is my form: both group1 and group2 hit the same table on the same form

Example:===========================================

Report number ____ (field)

(Group1 - this is from a join "People_Table")
Please Enter teacher name: ______ (non repeatable group)
<-- how do I configure fabrik that this particular entry will be a "teacher" type record in the database since I'm using the same table for PersonType "student".--->


<form page break>
(Group2 - this is from a join "People_Table")
Please Enter student name: ______ Grade:______ (repeatable up to 10) <-- how do I specify this is a "student" type record.
...
<--how do I configure fabrik that this particular entry will be a student"type" in the database since I'm using the same table for PersonType "teacher".--->


Does fabrik have something to validate this or should this be done via javascript? Should I used javascript to check the groupID and enter the default "PersonType" into the database.
Such as: If Group2 enter "student" in the PersonType field, else enter "teacher"?


I hope this makes sense.

Thank you
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top