Hello,
Could you please help me? I have form which runs a query depending on the fields filled in by the user. The form also has a checkbox. I keep getting Undefined index error when I try to submit the form without checking the box. This is not what I want as I want the checkbox selection to be optional. I have been trying to fix it but I just don't get how checkboxes work.
Any help you offer would be greatly appreciated.
Thanks
Notice: Undefined index: issue!!
Moderator: General Moderators
Re: Notice: Undefined index: issue!!
Checkbox values are not send in the request, when they are not checked. This is by design.
So when you are checking if checkbox is checked, you have to use isset(), and not simply check the value
So when you are checking if checkbox is checked, you have to use isset(), and not simply check the value
Re: Notice: Undefined index: issue!!
Ahhh!! That explains a lot. Thanks ever so much Darhazer.
Re: Notice: Undefined index: issue!!
Thanks a lot!! That worked for me.Darhazer wrote:Checkbox values are not send in the request, when they are not checked. This is by design.
So when you are checking if checkbox is checked, you have to use isset(), and not simply check the value
Just ceasing the opportunity, do you know how to sort a table based on a column heading. At the moment, what I have got is a bit slow? This is due to the fact that my sort runs a query to the database and returns the result. I know there are other better ways of doing this but my knowledge of php isn't that deep.
Re: Notice: Undefined index: issue!!
Post your code and we will see why it's slow 