2 Replies Latest reply on Apr 28, 2008 5:26 AM by (alterity)

    redirect trigger failure: page redirects to itself!

      The situation is this.

      When creating an insert transaction associated with a form, submission of the form successfully inserts record but redirect fails. No redirect takes place. Submission leaves the user on the same form page as if nothing had happened.

      Behind the scenes here's what's going on.

      The url from the default redirection trigger is not being inserted into the form action. INSTEAD the KT_getFullUri function which is supposed to dynamically add the redirect url to the form action is INSTEAD inserting the url of the of the FORM, that is, the address currently visible in the address bar of the browser.

      For instance, if I add some variables to the form's address in the address bar, refresh the page and then look at the source, the form action is now the form's address plus the variables.

      So obviously the page doesn't go anywhere when the form is submitted.

      I can't figure this one out. Very mysterious. Has anyone experienced this before and what's going on and how do you fix it?

        • 1. Re: redirect trigger failure: page redirects to itself!
          Level 1

          ADDT forms are actually designed to have the form action be set to the same page as the form itself. In other words, when you submit an ADDT created form, it always submits to itself, not to the redirect page.

          This is not an unusual way to handle forms, and is done this way for several reasons. One is because this is one of the best ways to do server side and client side error checking. It makes it easier to keep the submitted data in the form when there is an error with the form.

          The redirect is only handled after a sucessful Insert transaction. I suspect all the redirect does is set the header to go to the redirect page if the Insert transaction is successful.

          I have had a similar problem where the form would submit and return to the form page. However, the data was not inserted into the database in my case. Someone had modified the code accidentaly, and unfortunately I never tracked the problem down because I just reuploaded a back up of that page to fix the problem.

          Check to make sure your redirect is correctly set with the correct path to an existing file. I think this may happen if you don't have it correctly pointing to an existing page.

          Hope this helps,

          • 2. Re: redirect trigger failure: page redirects to itself!
            Level 1
            Shane, thanks for your very precise and very informative answer. I did not know that about the get URI function. I always thought it grabbed the redirect and dumped it into the form action.

            But I'm still baffled by what's happening in my case. As I say, the form data DOES get inserted into the DB but the page does not redirect. The redirect page is just a simple thanks.php file sitting the the same directory as the form. It's possible I misspelled it, I guess. I'll check that, but it's unlikely.

            But in any case, you've enlightened my about what's going on behind the scenes so it's something to go on and do some more troubleshooting.

            Thanks very much for your help!