Login extra - set success placeholder after password change

I’m using the login extra to display a change password form using the ChangePassword snippet. I want to display a success message after successful submitting the form.

There’s a property &reloadOnSuccess:

If 1, the page will redirect to itself with a GET parameter to prevent double-postbacks. If 0, it will simply set a success placeholder. (Quote from the docs)

So if understand correctly, there’s no success message placeholder set, when this is set to 1.


Comparing this to the UpdateProfile snippet, there the same functionality is used (with the GET redirect) but there’s also a success message placeholder set:

[[!+login.update_success:is=`1`:then=`Success`]]

Is there no similar success message in the ChangePassword snippet? As the &reloadOnSuccess is set to 1 by default, I assume it is recommended to keep it this way. But the user should still get visual feedback, that their password change went through.

MODX 2.8.4

It’s seems there is a property reloadOnSuccessVar. If I read the code correctly, then this is the name of a GET-parameter on the redirect. Maybe you can use the value of this GET-parameter to output a success message.

Thank you, know that you mention it, it seems quite obvious. I guess I was hung up by the fact that the UpdateProfile snippet has this covered and I assumed I just missed something as it’s the same extra.

I got a working solution using the getUrlParam snippet/extra:

[[!getUrlParam:is=`1`:then=`Success`? &name=`logcp-success` &int=`1`]]

Thank you again!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.