Welcome Guest, Not a member yet? Register   Sign In
values from checkbox
#1

(This post was last modified: 02-19-2020, 11:22 PM by albrechtmyers.)

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/
Reply
#2

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.
Reply
#3

Keep in mind that checkboxes and radio buttons have no value if they are not checked.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB