11 Replies Latest reply on Oct 3, 2008 8:43 AM by oicram

    Successful update message?

      I have a situation where I update a database record with data collected in a form. I would like to display a message on the page telling the user that the update has been successful. Is this possible with ADDT? Obviously the page will be refreshed after the 'Submit' is clicked instead of redirecting to another page.
      Any help would be appreciated.
        • 1. Re: Successful update message?
          Level 1
          Phil,

          Please give a little more detail about what you are trying to do.

          What are you trying to do that's different from just redirecting to a page that gives an "Update Successful" message?

          Are you trying to display "Update Successful" on the same page with the update form and not redirect to another page? In other words, the person fills out the form, hits submit, the form is submitted and the same update form is displayed again with the message "Update Successful"?

          Please give a bit more detail about what steps the user should see and let's see if we can get you pointed in the right direction.

          Shane
          • 2. Re: Successful update message?
            921creative
            It doesn't look like Phil gave any more details, but if I may follow up, this is exactly what I would like to be able to do with my update record forms. After a successful update, the user would remain on the same page, and a message like "Your settings were successfully updated." would appear just above the form, almost like an error message would if there had been a problem. Is this an ADDT function or does it need to be hand coded?
            • 3. Re: Successful update message?
              Günter Schenk Level 4
              Folks,

              may I ask what this would be good for actually -- and wouldn´t it be better not to display the form once again in order to keep the user from possibly submitting it multiple times just because he can ?

              -------
              Is this an ADDT function or does it need to be hand coded?
              -------

              there´s no ADDT function which does that, and you most probably would have to hand code some sort of AJAX "response" which e.g. updates the contents of an initially empty "div" or something like that.

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Successful update message?
                oicram
                @great_master_Gunter_Schenk :)

                *****
                "may I ask what this would be good for actually"
                *****

                I believe that, with this solution:

                a) Instead of having a new page, all happens on the same page. Simple economy, nothing else.
                Also,
                b)Quickier(?): Instead of having to reload a new page with the exactly same layout as the form page and a add-on saying: Updated, it would be quicker(?) (so, performance issue), if it only appears a image or a text or whatever, telling: Your record as been updated.

                *****
                "and wouldn´t it be better not to display the form once again in order to keep the user from possibly submitting it multiple times just because he can ?"
                *****

                No. :)
                1º The user will perfectly see that the record as been updated.
                2º In same scenarios we can image that that is just one extra page that we don't need. (i.e. When the user sees an interface that allows to update several pages at once, why should he see a new page telling "Page updated" and then click to go back to the previous page to keep editing? It will be, immo, far more practical, to have a message on the page.

                SO...

                It will be a nice feature. :D

                @adobebrian
                As a stupid workaround, normally, after I made all the layout of the insert or update form, I just copy that page, I change is name to "update_success" or whatever, and I add a message telling "the update was ok".

                But I'd love to see that feature to.

                [update] @adobebrian
                A popup windows with a sucess message will also be nice (because the user will not loose the visual contact with the main page), and when the user closes the popup windows, he will refresh the parent window. I've done this a long time ago (I don't remember), I'm sure you will find some info on this over the web...
                • 5. Re: Successful update message?
                  Günter Schenk Level 4
                  Hi Marcio,

                  thanks for this sophisticated argument :-)

                  However, when all you need is some "Page updated" message, why not simply doing it this way:

                  1. append a static URL variable to the update form´s redirection, say: "&update_message=Y"

                  2. in your Dynamic List, respectively the page the form is redirecting to, add your message on top of the list and...

                  3. use ADDT´s "Show IF conditional Region" to only display this message when the URL parameter "update_message" equals "Y".

                  I´d personally never ever dare using the (original, or a second instance) form for this, because:

                  -------
                  1º The user will perfectly see that the record as been updated
                  -------

                  when trying to build secure web applications, you know the golden rule: never trust your users ;-)

                  ------
                  2º In same scenarios we can image that that is just one extra page that we don't need. (i.e. When the user sees an interface that allows to update several pages at once, why should he see a new page telling "Page updated" and then click to go back to the previous page to keep editing? It will be, immo, far more practical, to have a message on the page
                  -------

                  it doesn´t really make sense to break the standard List -> Form -> List chain, all the more both DW and ADDT provide a redirection mechanism .

                  If you really prefer a technically simple solution and without resorting to AJAX features respectively adding yet another "dummy" form "in between" just for displaying that message, I think my approach described above should be worth giving a try.

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Successful update message?
                    oicram Level 1
                    ***
                    thanks for this sophisticated argument :)
                    ***
                    :p

                    ***
                    when trying to build secure web applications, you know the golden rule: never trust your users ;)
                    ***

                    Yes indeed. But we can also think a several manners to avoid an extra-page scenario and, keep the user from updating "again". (i don't know how to do it, but I'm sure that there is solutions).
                    Anyway, I understand what you are saying, but I'm also asking, if we should/can control the user perfectly so he can never do mistakes, and, in this case, never inserts a record again.
                    The fact that the users have autonomy to break some rules, is not quite in our control. We control a bit, ok, but even if we apply a "go to success page" approach, maybe that will not keep the user from do it again. (I know, it will be less probable, but what I'm trying to say is that, yes, never trust your users... ok... but we have to do it at some point anyway.)

                    ***
                    it doesn't really make sense to break the standard List -> Form -> List chain, all the more both DW and ADDT provide a redirection mechanism
                    ***

                    This could be the point. I do agree.
                    But in this scenario I don't have a list. So, after Update, I have no List to go. :) That's why I just want to display the message. :) (this is a also common scenario of a single record update (i.e. updating a "What's New Page" via database). BUT, since I have one page for doing multiple things, I want the users to stay on that page to do other things if they want. That's the main reason why I prefer a "Just Pop Up me a message" approach. :)

                    ***
                    If you really prefer a technically simple solution and without resorting to AJAX features respectively adding yet another "dummy" form "in between" just for displaying that message, I think my approach described above should be worth giving a try
                    ***

                    Yes. I have tried to apply your approach, and when I added an "Update Transaction" to the page, in the "redirect on success" field, I have put the name of the page that updates, follow by URL static variable, like this:

                    this_update_page.php&update_message=Y

                    After this I have write the error message:
                    "The Record as Been Updated. Yes I know its tempting to add another record now, BUT PLEASE, don't! Otherwise, our amazing controlling system will know that you have done it, and will chase you to the death!!!! So... please don't. And don't ask me why we have a so advanced control system but we can't avoid you to add another record. :)"

                    And when I apply a Show If Conditional Region, on this, I write:
                    Expression1:

                    ==

                    Expression2:Y

                    It doesn't work. I get a page not found. So I suppose I've not put the right syntax on the "redirect to page" field.

                    And also, I'm not sure if: $_GET['update_message'] is the right way to get a Static URL variable that comes from the same page. :s

                    Any Hilfe bitte? :D

                    Márcio
                    • 7. Re: Successful update message?
                      oicram Level 1
                      OK. :)

                      ***
                      1. append a static URL variable to the update form´s redirection, say: "&update_message=Y"

                      2. in your Dynamic List, respectively the page the form is redirecting to, add your message on top of the list and...

                      3. use ADDT´s "Show IF conditional Region" to only display this message when the URL parameter "update_message" equals "Y".
                      ***

                      Works perfectly. I only made a little change. On the "After Updating go to:" field, I have put ?update_message=Y, so ? instead of &.
                      I thinks it's because I'm using PHP and that's the way we can append something to the URL? (I'm not sure).

                      SO,
                      Thanks a lot SIR Günter Schenk :)
                      Is a mutch less dummy method and it works like a sharm. :D
                      • 8. Re: Successful update message?
                        Günter Schenk Level 4
                        Hi Marcio,

                        -------
                        Works perfectly. I only made a little change. On the "After Updating go to:" field, I have put ?update_message=Y, so ? instead of &.
                        I thinks it's because I'm using PHP and that's the way we can append something to the URL? (I'm not sure)
                        -------

                        you can actually use both the ? and the & -- the difference is:

                        1. the very first variable will have to be appended using the ?, like what you now did.

                        2. all following variables are getting appended using the &

                        This way you can even define a chain of appended URL variables, e.g. whatever.php?var1=blabla&var2=blablabla

                        -------
                        After this I have write the error message:
                        "The Record as Been Updated. Yes I know its tempting to add another record now, BUT PLEASE, don't! Otherwise, our amazing controlling system will know that you have done it, and will chase you to the death!!!! So... please don't. And don't ask me why we have a so advanced control system but we can't avoid you to add another record. "
                        -------

                        LOL :-) My default messages are much shorter: "update was successful you moron" ;-)

                        Cheers,
                        Günter Schenk
                        Adobe Community Expert, Dreamweaver
                        • 9. Re: Successful update message?
                          oicram Level 1
                          Günter I need your help one more time please,

                          On the "links tab", here:

                          http://www.cantinho.org/admini_/modulos/editar_paginas/ADMINI_editar_paginas.php

                          Each time we push save options, he pulls out a bunch of "O link foi actualizado com sucesso!!!" update messages.

                          This is correct since I have it inside a repeat region.

                          But I want this message to show, only near the record that the user updates, and not all records.

                          I thought like this:
                          I put a $counter and then I generate different button names and different div names with the update message inside.
                          I put a onclick event on the "button_X" saying: on click, Show the DIV_X.

                          For all this to work, I need to FIRST hide the DIV that contains the conditional region with the message. But for some reason this doesn't work:

                          <[div id="update_link_sucesso" style="display:none;">
                          // Show IF Conditional region3
                          if (@$_GET['update_sucesso_link'] == "Y") {
                          ?>

                          O link foi actualizado com sucesso!!!


                          // endif Conditional region3
                          ?>


                          and call a onload function on body, doesn't work either.

                          Each time I click a update button I get this message.
                          "O link foi actualizado com sucesso".

                          But I want him to hide the DIV (with a conditional region inside) and only show it, when the user clicks a specific button.

                          Why he is not hiding?
                          • 10. Re: Successful update message?
                            oicram Level 1
                            SORRY.

                            My last post makes no sense. It was always showing because the redirection pages where not correct. So, if anyone can, please delete this and the other post, because it may lead do confusion.

                            Thanks.
                            • 11. Re: Successful update message?
                              oicram Level 1
                              AAAAAHHHHHH!!!!!!!! (Screaming like a wild animal).

                              HILFE BITE:

                              Here on the "LINKS" TAB:

                              http://www.cantinho.org/admini_/modulos/editar_paginas/ADMINI_editar_paginas_4.php

                              How can I set the update message to display only on the instance where the user click "save options", and not on ALL repeated instances?

                              I don't need a step by step process, I just need some lights...

                              I have try to hide the div that contains the message, to show it onclick, based on a counter, but this don't work because:

                              1) The only I as able to hide the div tag was by adding style="display:none;" on the div. But is hard-coded, so I think we cannot change this value.

                              2) I have tried with a function hiddedivs(); called on the head section that hiddes based on the div ID but this don't hide the div inside de tags and I don't know why. :s

                              How can this be done... just some lights please...

                              Márcio