Jump to content


Photo

Multiple Checkbox help


  • Please log in to reply
2 replies to this topic

#1 lilywong

lilywong
  • Members
  • PipPipPip
  • Advanced Member
  • 56 posts

Posted 26 July 2006 - 06:38 AM

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

#2 bltesar

bltesar
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 27 July 2006 - 06:17 PM

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. 

#3 Annady17

Annady17
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 25 May 2009 - 05:18 AM

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

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.



_________________
Cuno Filters




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users