![]() If you're not sure what to do you can redirect to the previous page.Ħ. What happens if none of the checkboxes (I presume they were) were checked? Or something not 1-4? Even if it's not supposed to happen you should try to account for it. Code that does this probably has some fundamental problem, like there only being one actual item or not putting something important, like output, inside the loop as well.ĥ. Everything before it will be overwritten each time through the loop. Only the last checkbox (with a value 1-4) will matter. When you submit the form, youll receive multiple values on the server under one name. ![]() ![]() It's not bad per se, just unusual and potentially confusing.Ĥ. A form may contain multiple checkboxes with the same name. A: - Checkboxes all bearing the same name attribute, require them to be treated as arrays youre not doing that, in turn overwriting all other checkboxes chosen. If ($checkbox= '1' & $checkbox= '2')s around your loop. One = is assignment, two =s is comparison. Now the problem is.no matter which checkbox is selected, the program will only run 'if statement' , If checkbox 1 and 3 is selected, result with result_id 5 will be shown. jQuery is plain javascript with perhaps some added. PHP cant check for something if the client does not send it. Also, you need to understand the client-server flow. If the checkbox is not selected, it wont be set. So, if checkbox 1 and 2 is selected, result with result_id 4 will be shown. In case of checkboxes, you dont really need to check the value, but just that it exists. Can anybody help me to check what's wrong with the coding.įirst, i get the value of checkbox from the previous page.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |