Jump to content

Multiple Checkbox help


lilywong

Recommended Posts

I have a set of checkbox as below

* Soft Drink
* Cold Drink
* Mineral Water
* None

<code>
<input type="checkbox" name="chkFolder1" value="001">Soft Drink
<input type="checkbox" name="chkFolder2" value="002">Cold Drink
<input type="checkbox" name="chkFolder3" value="003">Mineral Water
<input type="checkbox" name="chkFolder4" value="004">None
</code>

User allow to select multiple choice from the set of checkbox, for eg, user select soft drink and mineral water, these 2 items will be saved into a database, as (001,003) in a same field called choice.

when i retrive from database, how should i separate the data from choice so that soft drink and mineral water is checked when i retrive the data?

thanks
Link to comment
Share on other sites

More information is really needed to answer this question.  To make checkboxes checked, just add 'checked' at the end of the checkbox tags, e.g.

<input type="checkbox" name="chkFolder1" value="001" checked>Soft Drink
<input type="checkbox" name="chkFolder2" value="002">Cold Drink
<input type="checkbox" name="chkFolder3" value="003" checked>Mineral Water
<input type="checkbox" name="chkFolder4" value="004">None


This can be achieved in a variety of ways from the database. 
Link to comment
Share on other sites

  • 2 years later...
[quote author=lilywong link=topic=101887.msg403657#msg403657 date=1153895884]
I have a set of checkbox as below

* Soft Drink
* Cold Drink
* Mineral Water
* None

<code>
<input type="checkbox" name="chkFolder1" value="001">Soft Drink
<input type="checkbox" name="chkFolder2" value="002">Cold Drink
<input type="checkbox" name="chkFolder3" value="003">Mineral Water
<input type="checkbox" name="chkFolder4" value="004">None
</code>

User allow to select multiple choice from the set of checkbox, for eg, user select soft drink and mineral water, these 2 items will be saved into a database, as (001,003) in a same field called choice.

when i retrive from database, how should i separate the data from choice so that soft drink and mineral water is checked when i retrive the data?

thanks
[/quote]
I just wanna say thank you for posting this checkbox.. Hoping that this will not be the last post that I could be read written by you.



_________________
[url=http://www.ep-filters.com/]Cuno Filters[/url]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.