7 Replies Latest reply on Jul 17, 2007 8:14 AM by Günter Schenk

    Checkboxes in Insert Record Transaction

    oicram Level 1
      Hello all,

      PHP, MYSQL, ADDT,

      I have create a insert transaction with a checkbox. that checkbox will correspond to a enum datatype in my mysql db, with "yes" and "no" as values.

      The default value of that database field is set to "no" in the database properties.

      Problem:

      When I DO NOT select the checkbox, instead of getting a "no" in DB, I get null.

      Even if I define, in the "Insert Record Transaction" a "Default Value" to "No", I still get a null value in the database.

      If I quit that field from the "Insert Record Transaction" behavior, and I see the record inserted, I will see "No" as default so, its not a database issue.

      Why my Insert Record Transaction Keeps doing a null when the default is set to no?

      ps- my "submit as" is assemble to "text", but it is like this since I have a enum datatype in my mySQL database.



      Please help me,

      Márcio
        • 1. Re: Checkboxes in Insert Record Transaction
          Level 1
          I found the same issue.. what I had to do is pass the no value to another page in a hidden field in order to insert the no value in the db.. but there has to be a better way
          • 2. Re: Checkboxes in Insert Record Transaction
            oicram Level 1
            Instead of using 'yes' and 'no', now i'm using 'yes' and null.

            I agree it should exist a better way.
            Anyone please?!!
            • 3. Re: Checkboxes in Insert Record Transaction
              Level 1
              funny today I used a check box 'Y' and 'N' default values and everything works fine
              • 4. Re: Checkboxes in Insert Record Transaction
                oicram Level 1
                Yes, with 'Y' and 'N' it works, since we have that option in the insert transaction. But 'Yes' 'No, or, 'Oui' 'Non', or 'Sim' 'Não' that does not work. :S and thats the problem, I'd like to solve this.
                • 5. Re: Checkboxes in Insert Record Transaction
                  Günter Schenk Level 4
                  Hi folks,

                  just FYI, ADDT has been designed to work with the following checkbox value options:

                  Y,N
                  1,0
                  -1,0

                  In case you want to display those values in a "user friendly" way on a certain page, just use ADDT´s "Show If conditional region" server behaviour with the following condition:

                  if:

                  "expression 1" (let this one point to the respective Y/N field from your recordset) == "expression 2" (Y)

                  Oui

                  activate the "has ELSE" option

                  Non

                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Checkboxes in Insert Record Transaction
                    oicram Level 1
                    Thanks Günter,

                    Anyway I prefer if the checkboxes can handle enum data types, so he can accept other values without using extra code.

                    Its not a big issue, we can easily work around, but I think there is a bug in the ADDT when we put a default value to "no" and he cannot insert that "no" value in the database, and put null instead.
                    Or, if its not a bug, what does the defaut value in the insert record transaction for, cas,IMMO the help documents should be more complete concerning the transactions (without the wizards).

                    Good day, and thanks for answering.
                    • 7. Re: Checkboxes in Insert Record Transaction
                      Günter Schenk Level 4
                      Hi Marcio,

                      I saw that you now posted this question to the Interakt forums as well -- however, the way ADDT respectively it´s predecessor MX Kollection handles fields which have been declared "checkbox", restricts this field type to the above mentioned options.

                      >
                      ...but I think there is a bug in the ADDT when we put a default value to "no" and he cannot insert that "no" value in the database, and put null instead
                      >

                      yeah sure, but that´s how ADDT has been conceived in this respect - what can I say ? :-D

                      However, in all those years I´m using it now, I managed to accustom myself to this specification and either used the field type "Menu" or "Radio Group" and provided the desired "yes/no" values as static options

                      Günter Schenk
                      Adobe Community Expert, Dreamweaver