HTML, PHP, forms, submitting data Problem
i have a form with multiple input text fields along with a checkboxes. Problem is not displaying the data but inserting the data into the database. See with checkbox only the values that are checked are submitted. With the text field every value is submitted. So the post data looks like this
[MasterBehaviorPlanFrequency] => Array ( [0] => [1] => [2] => [3] => skip a few inputs [127] => 3 [128] => 3 [129] => 3 ) [MasterBehaviorPlanAddDB] => Array ( [0] => 61 [1] => 91 [2] => 75 ) How can i match up the data? Thanks in advance. |
You could name your <input> accordingly, say check_1 and text_1, check_2 and text_2...
Then, you parse the post array like : PHP Code:
|
see the problem is that php does not see checkboxes that aren not checked. But your code has solved a few things in other chunks of code i have. Do you have any idea how i can get php to see unchecked boxes?
|
You could test if the checkbox variable name is set in $POST
PHP Code:
say for 8 couples of text input/checkbox beginning at number 1 PHP Code:
|
All times are GMT -5. The time now is 03:43 PM. |