5 Replies Latest reply on May 8, 2009 6:11 PM by DwFAQ

    Adding message box on update.

    xriokax

      Hello

       

      I am using an ADDT update form to allow my site user to update their site profiles.

       

      My redirect page is the same URL as the original form.

       

      Currently the user is return to the edit profile screen with no prompt to alert them to a sucessful update.

       

      Can someone sugest how I can add in a message box after the re-direct to confirm back to the user?

       

      TXT file of my code attached.

       

      Cheers

       

      Paul

        • 1. Re: Adding message box on update.
          DwFAQ Level 4

          Heya,

           

          To add a message pop-up box informing the user that their changes have been updated on the redirect page you can setup a javascript pop-up box - something like lightbox to fire onload with confirmation message.  Then setup a conditional region to fire onload lightbox when profile is updated or usual update form if not. It's kind of tricky to setup and maybe too much to explain here quickly but hopefully the tips will help.

           

          Another option is to just go to a different redirect page for update confirmation.

          In your code just change this line

           

          $upd_login->registerTrigger("END", "Trigger_Default_Redirect", 99, "member-centre.php");

           

          to something like this:

           

          $upd_login->registerTrigger("END", "Trigger_Default_Redirect", 99, "confirmation.php");

           

          Then on confirmation.php have your confirmation message with meta tag redirect to another page if desired.

          • 2. Re: Adding message box on update.
            xriokax Level 1

            Hey...

             

            I thought "lightbox" was used for displaying images not confirmation messages?

             

            If applicable can you explain further?

             

            Regards

             

            xriokax

            • 3. Re: Adding message box on update.
              DwFAQ Level 4

              'lightbox, 'lytebox, 'thickbox, etc. can be used to display images, html, or whatever you want. I'll explain how to do it using lytebox sense that's the one I've used on my website. Upload lytebox files to your server and link files to your page. To have a lytebox open upon pageload enter this code into the <head> of your page:

               

               

               

              <script language="javascript">
              var timeoutID = null;

               

              function loadLytebox(id) {
              if (typeof myLytebox != 'undefined') {
              // if the myLytebox object exists, start it up!
              var a = document.createElement("a");
              a.href = "
              /page.php";
              a.rel = "lyteframe";
              a.title = "
              http://DwFAQ.info";
              a.rev = "width:
              770px; height: 687px; scrolling: no;";
              myLytebox.start( a, false, true);
              } else {
              // wait 1/10th of a second and attempt loading again...
              if (timeoutID) { clearTimeout(timeoutID); }
              timeoutID = setTimeout('loadLytebox()', 100);
              }

              }
              </script>

               

               

              Then replace <body> with this:

               

               

              <body onLoad="loadLytebox();">

               

               

              This will open your page with page.php in lytebox which can include your confirmation message or any other html code you want. You can change page.php to image.jpg, page.html, or whatever your want respectively. Add code into conditional region(s) so if record updated show lytebox code(s). There are examples of signup/login/email confirmation messages using a combination of lytebox and redirects on my website.

              • 4. Re: Adding message box on update.
                xriokax Level 1

                Hey

                 

                Thanks for that, one last thing...

                 

                How exactly can I tell if the page has been updated?

                 

                Is there a variable = to something after an update or what?

                 

                Cheers

                 

                Paul

                • 5. Re: Adding message box on update.
                  DwFAQ Level 4

                  Heya,

                   

                  There's lots of different ways to tell if a profile has been updated. You could do something like custom trigger on login that rewrites 'updated' field to 0 then on update page custom trigger to write 'updated' field to 1. On update confirmation page add another custom trigger to again rewrite 'update' field back to 0. This will show no update upon login, updated when profile is updated, after directing to update confirmation page DB is rewritten back to not updated so that you can update with new update confirmation if you update your profile more than once in one session. That's one way I'd go about doing it.

                   

                  Another less-effective but easier way would be to send a URL parameter from update page to confirmation page upon update then check URL parameter against conditional region. This method is less-effective sense a user could manually add the URL parameter to view the update confirmation message despite fact their profile was never updated. Easier to code sense there's no DB/custom triggers involved but not as effective.