6 Replies Latest reply on Apr 2, 2008 1:02 PM by (jay_stoler)

    Problem with custom Trigger

      I have created a registration app and want to have a conditional redirect when the form is submited. If there is only one registrant they fill out the form and submit it. If they want to register a second registrant I have put a checkbox at the bottom of the form and assigned it a Redirect Trigger.

      The condition to return to a second registration form is when the checkbox is checked. I named the checkbox "second" and the value as "Y".

      The Trigger is an END Trigger with a priority of 90 and I used the condition builder to build the condition. if('second')== 'Y'. The Default Redirect Trigger is 99. If checked the redirect of 90 should fire, right?

      It doesn't work. Is this the right way to do it? It seems like such a simple thing to do but somehow I fear I am not interacting correctly with the Trigger behavior!!

      Any help? Thanks much.
      Jay
        • 1. Re: Problem with custom Trigger
          Günter Schenk Level 4
          Hi Jay,

          ----
          if('second')== 'Y'
          ----

          it´s exactly that code which is displayed the Condition Builders´s field ? Just wondering, because usually you´d rather see something like {second} == "Y" -- means the transaction field that´s declared within the curly brackets {} normally doesn´t get enclosed with apostrophes and usually should be {second}

          Interestingly Dreamweaver has the habit to add such apostrophes around terms which it identifies as "reserved words" -- and although "second" isn´t a reserved word for MySQL, it´s actually reserved for e.g. ODBC and PostgreSQL 8

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Problem with custom Trigger
            Level 1
            Gunter,
            Thanks for your response. The registration is actually for a dog training school, so I made the field second_dog and went back and created a custom transaction and then a custome trigger redirect. The information did insert into the DB, but then I got this error:

            KT_DynamicData:
            Column second_dog is not part of the current transaction.

            The second_dog is only a checkbox I placed on the page to facilitate a conditional behavior. Does second_dog have to be a field in the DB to work, or is there another way.

            Again, thank you for the much appreciated help.

            Best,
            Jay
            • 3. Re: Problem with custom Trigger
              Günter Schenk Level 4
              Hi Jay,

              -----
              Does second_dog have to be a field in the DB to work
              -----

              yes, but adding this checkbox to the transaction (read: saving the value in MySQL) won´t come in your way when using an approach that similar to what I´m describing in my tutorial "Image & File Upload: overwrite existing file" : http://www.guenter-schenk.com/tutorials/tutorial.php?id=7 (Chapter: 4. Scenario 2: have a choice)

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Problem with custom Trigger
                Level 1
                Three Cheers and a big thank you, not only for the tip, but for the wonderful array of ADDT tutorials. I look forward to perusing your site to the fullest.

                I added a column to the DB and created a custom transaction and conditional redirect trigger and it worked flawlessly.

                I don't know why I was thinking it could be done without a DB column within the ADDT style framework. But the column actually comes in handy as a sort field when I pull class rosters and client reports.

                Thanks again and I will be reading every tutorial and/or buying your book. You are a very good instructor.

                Best regards,
                Jay
                • 5. Re: Problem with custom Trigger
                  Günter Schenk Level 4
                  Hi Jay,

                  -----
                  Thanks again and I will be reading every tutorial and/or buying your book. You are a very good instructor.
                  -----

                  thanks for your nice words, much appreciated ! But what book are you talking about ? I haven´t written one nor will I ever do this :-)

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Problem with custom Trigger
                    Level 1
                    Sorry, thought you wrote a book, maybe it is just wishful thinking. Too many people who shouldn't be writing are. ;-)

                    I'll just be grateful for your tutorial site and vigilant monitoring of the forum.

                    Thanks again,
                    Jay