Menu

Form: Field Values Issue

Help
mrmunka
2007-08-09
2013-06-03
  • mrmunka

    mrmunka - 2007-08-09

    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?

     
    • mrmunka

      mrmunka - 2007-08-12

      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.

       
      • Fred Mulharin

        Fred Mulharin - 2007-08-13

        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

         
      • TNTEverett

        TNTEverett - 2007-08-15

        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. 

         
        • Fred Mulharin

          Fred Mulharin - 2007-08-15

          And how is this accomplished?

           
    • mitch

      mitch - 2007-08-13

      im glad you posted a solution to your own problem... im having the same.  thx

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.