Welcome Guest, Not a member yet? Register   Sign In
Handling Multiple Checkboxes
#5

[eluser]Craig A Rodway[/eluser]
HTML code:

Code:
<input type="checkbox" name="day[]" value="1" id="monday"  />...
<input type="checkbox" name="day[]" value="2" id="tuesday"  />...
<input type="checkbox" name="day[]" value="3" id="wednesday"  />...
<input type="checkbox" name="day[]" value="4" id="thursday"  />...
<input type="checkbox" name="day[]" value="5" id="friday"  />...

If you tick Monday, Wednesday and Friday; you will get an array ($days = $this->input->post('day')) which has 3 elements - the values 1, 3 and 5. Then you can do whatever you want with the array - implode(), serialize(), whatever...


Messages In This Thread
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:13 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:29 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:31 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:37 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 01:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB