CodeIgniter Forums

Full Version: values from checkbox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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/
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.
Keep in mind that checkboxes and radio buttons have no value if they are not checked.
(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.