CodeIgniter Forums
values from checkbox - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: values from checkbox (/thread-75302.html)



values from checkbox - albrechtmyers - 01-24-2020

Hello.

I want to post of textvalue+checkbox value into the form



<input type="checkbox"id="mycheck2" name="certid[]" value="2" class="cbx"  > 



<input type="number" id="primaryincome2"  min="0"  max="999" name="noc">



I want to get the values like 

1_1

2_1

3_1

4_2

the first value from checkbox and second value from textbox (no of copies)

https://4kpornindex.com/


RE: values from checkbox - jreklund - 01-24-2020

If I understand you correctly you will need to use the input class.

$this->input->post('checkbox') and $this->input->post('number'). And append them together with an _.

$string = $this->input->post('checkbox') . '_' . $this->input->post('number');

If this is not what you want. I'm afraid you will need to clarify.


RE: values from checkbox - InsiteFX - 01-25-2020

Keep in mind that checkboxes and radio buttons have no value if they are not checked.


RE: values from checkbox - dave friend - 01-31-2020

(01-25-2020, 09:03 AM)InsiteFX Wrote: Keep in mind that checkboxes and radio buttons have no value if they are not checked.

They not only have no value they are not POSTed if not checked.