Jump to content

Check Box Group Insert / How to handle the data


cdoggg94

Recommended Posts

I have a form with a check box like this:

 

 

<label>
               <input type="checkbox" name="CheckboxGroup1" value="Coaches" id="CheckboxGroup1_0" />
               Coaches</label>
             <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="Conveners" id="CheckboxGroup1_1" />
               Conveners</label>
             <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="Officials" id="CheckboxGroup1_2" />
               Officials (Both)</label>
               <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="Ref" id="CheckboxGroup1_2" />
               Ref</label>
               <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="Linesmen" id="CheckboxGroup1_2" />
               Linesmen</label>
             <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="Admin" id="CheckboxGroup1_3" />
               Admin</label>
             <br />
             <label>
               <input type="checkbox" name="CheckboxGroup1" value="All" id="CheckboxGroup1_4" />
               All</label>

 

Basically right now when I insert it, it accepts the lowest check box selected if multiple ones are checked.

 

I was wondering:

 

1) How to accept ALL of the checked values instead of only the lowest.

 

2) What is the best way to handle the data...When I had a radio group, i had the information going into a column called "date_who". With that information I could choose which group of people saw the specific information in the table.

 

I now want to be able to select multiple people but not "All".

 

I guess the question is; should I have the information in one cell? (i.e - date_who = 'Coaches, Admin, Linesmen')

 

or should i have a separate one for each ? (i.e date_coaches = 'Coaches' , date_converners = '' , date_officials = '' , date_ref = '' , date_linesmen = 'Linesmen' , date_admin = 'Admin' , date_all = '')

 

Attached is an image that might help explain it a little

post-106045-0-07140900-1361544025_thumb.jpg

With the data normalization, it basically says in my case that it would be best to add them like this:

 

(if coaches, officials and admin are selected..)

 

it inserts as 3 entries, one for each date_who value

 

What do i call that type of insert? or i guess how do i tell the insert to add 3 entries instead of 1 ?

Sorry if my questions are annoying, but I just want to be clear..

 

Basically i would have an insert to the same table i have now, inserting the same content.

 

Then have another table which holds the ID number of the new entry in the old table, the type, and its own ID ?

 

Does that sound right ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.