11 Replies Latest reply on Jan 26, 2008 3:35 PM by (Venkatesha)

    Create a Preview page before Form Submission - Help me it is Urgent!

      Hi Guys,

      I have create a form using INSERT FORM RECORD WIZARD. NOW, after the client enter's all the field and submit, i need to provide them with a preview page, so that they can make changes if there is any mistakes.

      Being new to ADDT, i am stuck up here, please help me it is urgent.

      And my thanks to Henrik Glensbo for the helping me earlier.

      Regards,

      Venkatesha
        • 1. Re: Create a Preview page before Form Submission - Help me it is Urgent!
          Level 1
          Hello,

          All you ADDT pros out there, is there an easy way to do what Venkatesha wants? I have done this myself, but it required a lot of hand coding on my part.

          The way I did it was to use ADDT's Custom Form Wizard to capture the data. Then I used a Custom Trigger to get the data posted from the form and set $_SESSION variables to hold the data. The next page has the INSERT form created with the ADDT Insert Form Record Wizard. When I ran the Insert Wizard I set the default values for the form fields to be the corresponding $_SESSION variable set on the first page. ADDTs markup code would be {SESSION.variable_name} So if you had a $_SESSION['first_name'] the ADDT code would be {SESSION.first_name}

          Is there an easy way with ADDT to do this with minimal hand coding needed?

          Just off the top of my head, you could create an ADDT Insert Form Record page and have the redirect page go to an Update Form Record page. So the first page would throw the information into the database, and the redirect page would pull up an Update form with the user's information that would let them edit that information. You would still need to do some hand coding here though.

          In the first step of the Update Record Form Wizard page(this would be the second page that is redirected to from the first page), you would set the Primary key equals to URL Parameter and set that to something like insertID.

          On the Insert Record Form page(the first page), you would need to get the primary key after insertion and change your insertion redirect link to put the primary key into the URL. This is what the Update page will be looking for in the URL.

          To do this you would have create a Custom Trigger set to execute AFTER the Insertion on the Insert page. The code in the custom trigger would look something like this:

          //start Trigger_Custom trigger
          function Trigger_Custom(&$tNG) {

          $insertID = $tNG->getPrimaryKeyValue();
          $tNG->addColumn("insert_ID","NUMERIC_TYPE","VALUE",$insertID);

          }
          //end Trigger_Custom trigger

          Then you need to change the redirect link. Look for:

          $ins_individual_tickets->registerTrigger("END", "Trigger_Default_Redirect", 99, "update_page.php");

          (update_page.php is whatever you have your update page named)
          and change to

          $ins_individual_tickets->registerTrigger("END", "Trigger_Default_Redirect", 99, "update_page.php?insertID={insert_ID}");

          My point in writting all this is to give you a little direction for how it can be accomplished, but I am hoping one of the pros will read this and provide an easier way to do this without any hand coding needed.

          Hope this helps,

          Shane
          • 2. Re: Create a Preview page before Form Submission - Help me it is Urgent!
            Günter Schenk Level 4
            Well,

            on the top of *my* head, I probably would go for a different approach, which is based on the fact that an ADDT Dynamic List can be easily modified to point the "add new record" link to a different page than the usual multiple/insert/update/delete form.

            Well, let´s point that link to an "add.php" page that´s containing a single Insert Record form -- to my mind it should work by having the data inserted into an extra "preview" table, and on the "redirect after insert" page retrieve that newly inserted record using a Dreamweaver Recordset, add yet another Insert Record form to that page where the form elements contain the recordsets data, and then insert that stuff to the "content" table ? After that you can have that page redirect to the Dynamic List

            What about that approach, folks ?

            Cheers,
            Günter Schenk
            Adobe Community Expert, Dreamweaver
            • 3. Re: Create a Preview page before Form Submission - Help me it is Urgent!
              Level 1
              Günter,

              That sounds like a good way to do it. I have a related question.

              I have not been able to get a Custom Form to see default values I set in the Wizard and populate a form with the values. I have tried to get it to see $_SESSION variables {SESSION.my_variable}, recordset data {Recordset.my_field}, and {GLOBAL.my_variable} with no luck. One thing to note, the Custom Form populates a form correctly on the front end of my site, but the same form on the back end admin section will not populate the form with the default values. The difference being that on the back end, I have ADDTs restrict access to page server behavior set.

              Maybe I should have started a new thread with this question, but I thought it was slightly related.

              Thanks for all your help.

              Shane
              • 4. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                Günter Schenk Level 4
                Hi Shane,

                if DW´s data binding Wizards can´t see that stuff, just click the form element in question, switch to CODE and add the desired SESSION variable to the form elements "value" like this:



                DW´s Wizards are far from being feature complete I guess, and it might be related to the fact that custom session variables are never displayed in the server behavious tab and hence assumingly not accessible to Dreamweaver

                ----
                The difference being that on the back end, I have ADDTs restrict access to page server behavior set
                ----

                guess you´ll have to experiment by kicking the "restrict access..." behaviour out and see if it makes a difference -- in other words: that´s something I can´t answer :-)

                Cheers,
                Günter Schenk
                Adobe Community Expert, Dreamweaver
                • 5. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                  Level 1
                  Thanks a lot for your help guys. But this is too much complicated for a beginner like me.
                  • 6. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                    Günter Schenk Level 4
                    Hi Venkatesha,

                    it´s clear that both Shane´s and my reply are pretty "tekkno", but your requirement is quite special and can´t be explained in simple terms -- I wish it could :-)

                    Someone would have to write an in-depth tutorial about that, I guess...

                    Cheers,
                    Günter Schenk
                    Adobe Community Expert, Dreamweaver
                    • 7. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                      Level 1
                      Thanks a lot Schenk. For all the help. Please let me know if i can use any of the example already provide on the website.
                      • 8. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                        Günter Schenk Level 4
                        Hi Venkatesha,

                        -----
                        Please let me know if i can use any of the example already provide on the website
                        -----

                        no, your specific approach is not (yet) covered by any ADDT tutorial

                        Cheers,
                        Günter Schenk
                        Adobe Community Expert, Dreamweaver
                        • 9. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                          Level 1
                          GUNTER SCHENK. Thanks a lot for your help. You may not be know this, you have provide this solution to some body else long time back and it really helped me. I need one more help, which will solve my complete problem....
                          • 10. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                            Günter Schenk Level 4
                            Hi Venkatesha,

                            you´re right, I really couldn´t remember that ! Thank YOU for searching the solution in these forums :-)

                            Cheers,
                            Günter Schenk
                            Adobe Community Expert, Dreamweaver
                            • 11. Re: Create a Preview page before Form Submission - Help me it is Urgent!
                              Level 1
                              Small problem. Could you help me. Drop down menu is not passing the variable. It is working perfectly for Text Field, Text Area, every, except for Drop Menu.