The check box fields are not having their value inserted correctly. The come out saying "array" in mysql. It's a single check box, checked = yes unchecked = null. I'm a little confused, the other fields have their values entered in correctly, and validation works. Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note "name=field_7[]" - Remove the "[]" so it reads "name=field_7" and then the "checkbox value" will be inserted correctly in MySQL. This should also work for radio buttons.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried what you suggested, remove the "[]", but still am having the same problem with "ARRAY" being written to the Database. Did I miss something?
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a difficult problem but you do need to be carefull that you get the selected value posted to you database.
When field_7[] returns "Array" it is because the form has an input field_7 which has multiple possible values.
Since your database probably has one table entry for the selected value, you need to be sure the database gets the selected value.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The check box fields are not having their value inserted correctly. The come out saying "array" in mysql. It's a single check box, checked = yes unchecked = null. I'm a little confused, the other fields have their values entered in correctly, and validation works. Any ideas?
So after some trial and error, I've figured out what is causing this.
<code>
<input name=field_7[] type=checkbox class=mainForm id=field_7_option_1 value="Yes" checked />
</code>
Note "name=field_7[]" - Remove the "[]" so it reads "name=field_7" and then the "checkbox value" will be inserted correctly in MySQL. This should also work for radio buttons.
I am assuming this is in the "form.html" FILE
I have tried what you suggested, remove the "[]", but still am having the same problem with "ARRAY" being written to the Database. Did I miss something?
thanks
This is not a difficult problem but you do need to be carefull that you get the selected value posted to you database.
When field_7[] returns "Array" it is because the form has an input field_7 which has multiple possible values.
Since your database probably has one table entry for the selected value, you need to be sure the database gets the selected value.
And how is this accomplished?
im glad you posted a solution to your own problem... im having the same. thx