Gossamer Forum
Home : Products : Gossamer Links : Discussions :

What is the best way of doing checkboxes?

Quote Reply
What is the best way of doing checkboxes?
I'm about to add some more data for the links records on our site, it will contain the following options for the user to choose from (they can and probably will choose multiple options, so this should probably be checkboxes, but advise if other).
Code:

Format:
Select each game format that your deck is allowed to play in by ticking the appropriate box

[ ] Standard Type II
[ ] Extended Format
[ ] Legacy Format
[ ] Tribal Wars Standard
[ ] Vintage Format
[ ] Prismatic Format
[ ] Singelton Format
[ ] Tribal Wars Classic
[ ] Online Classic
[ ] Pauper Format


So, my questions:
1. They will likely have multiple answers that they want to input, do I create a field in the Links table that is a checkmark field? And then add each one of the options listed above in the form names and form values? (I assume yes)

2. After someone has chosen multiple answers from the above list, how do I properly format the output on the detailed.html page?
What would the coding be for the include.form.html template so that when they come back to modify their listing the check boxes are already checked for the options they checked when they first added the listing? What is the best way to list the output on the detailed.html template so that it formats nicely and shows all the options that they selected?


3. What would be the coding to display the chosen options on the detailed.html template? I don't know how the info is stored in the database when multiple options are selected, so for all I know its stored as a giant run on sentence if they selected all the options (which is possible) so if I write it on the detailed.html template as simply
Code:

Deck Formats: <%game_formats%>

It might just display as
Deck Formats: Extended Format Legacy Format Standard Type II Vintage Format Online Classic Format
Which is going to look really whacked.

So I need to know what the best way is for lisiting the output on the detailed.html page when a user has selected multiple options in the include_form.html template.


4. Is there a better option than checkboxes for doing this kind of field in the database? Maybe a multi-select selection list?
If so an example of the best way to list the chosen options on the detailed.html template would be helpful as would a code snippet of how to write the multi-select selection list for the include_form.html template so that if they modify their listing later the options they chose originally in the multi-select selection list are already chosen for them when they return to modify the listing.



Please don't waste your time writing out the complete coding for all the options above when giving examples of what the coding is for the detailed.html template to display the chosen options nor for the include_form.html template. Just give me the coding for one or two options so that I have the starting point and I'll take it from there.

I know it's a lot of questions, but checkmark boxes and multi-select selection lists have never been my thing in Links, so I've always avoided using them in the past years.

Thanks,

Last edited by:

Westin: May 12, 2009, 5:43 AM
Subject Author Views Date
Thread What is the best way of doing checkboxes? Westin 5383 May 12, 2009, 5:41 AM
Thread Re: [Westin] What is the best way of doing checkboxes?
Andy 5325 May 12, 2009, 7:00 AM
Thread Re: [Andy] What is the best way of doing checkboxes?
Westin 5332 May 12, 2009, 7:02 AM
Thread Re: [Westin] What is the best way of doing checkboxes?
Westin 5319 May 12, 2009, 7:04 AM
Thread Re: [Westin] What is the best way of doing checkboxes?
Andy 5314 May 12, 2009, 7:06 AM
Thread Re: [Andy] What is the best way of doing checkboxes?
Westin 5333 May 12, 2009, 7:14 AM
Thread Re: [Westin] What is the best way of doing checkboxes?
Andy 5304 May 12, 2009, 7:16 AM
Thread Re: [Andy] What is the best way of doing checkboxes?
Westin 5265 May 13, 2009, 9:23 AM
Thread Re: [Westin] What is the best way of doing checkboxes?
Andy 5319 May 13, 2009, 10:16 AM
Thread Re: [Andy] What is the best way of doing checkboxes?
Westin 5256 May 13, 2009, 10:20 AM
Post Re: [Westin] What is the best way of doing checkboxes?
Andy 5266 May 13, 2009, 10:45 AM