<![CDATA[ Cannot display password changed success message... - My Forums]]> https://forums.modx.com/thread/?thread=70546 <![CDATA[Re: Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-531235 It's works

    [[!ChangePassword?
      &submitVar=`change-password` 
      &placeholderPrefix=`cp.` 
      &validateOldPassword=`1` 
      &validate=`nospam:blank` 
      &reloadOnSuccess=`0` 
      &successMessage=`Password has been changed` 
      &placeholderPrefix=`cp.`
    ]]

    [[!+cp.error_message:notempty=`
      <div class="alert alert-danger">[[!+cp.error_message]]</div>
    `]]
    [[!+cp.successMessage:notempty=`
      <div class="alert alert-success">[[!+cp.successMessage]]</div>
    `]]    

    <form class="form" action="[[~[[*id]]]]" method="post">
      <input type="hidden" name="nospam" value="">

      <div class="form-group">
        <label for="password_old">Old password</label>    
        <input class="form-control" type="password" name="password_old" id="password_old" value="[[+cp.password_old]]">
        <span class="error">[[!+cp.error.password_old]]</span>
      </div>

      <div class="form-group">
        <label for="password_new">New password</label>
        <input class="form-control" type="password" name="password_new" id="password_new" value="[[+cp.password_new]]">
        <span class="error">[[!+cp.error.password_new]]</span>
      </div>

      <div class="form-group">
        <label for="password_new_confirm">Retype new password</label>
        <input class="form-control" type="password" name="password_new_confirm" id="password_new_confirm" value="[[+cp.password_new_confirm]]">
        <span class="error">[[!+cp.error.password_new_confirm]]</span>
      </div>

      <div class="clearfix">
        <button type="submit" name="change-password" class="btn btn-primary">Change password</button>
      </div>

    </form>


Destroy Enjoy my brothers:)]]>
ezersky Sep 09, 2015, 06:33 AM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-531235
<![CDATA[Re: Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-410626 I got the same problem and I tried on Firefox and Safari.
I do not why but suddenly it works.
After testing it , I noticed that it works on Safari but not on Firefox.
The difference between both is that I was logged in Manager on Manager.
When I logout, it works on Firefox.

But I do nt think is the only reason, because it was not workinf on Safari too.

Here is my code:
First I created a page and I pasted this:
<h1>Modification du mot de passe</h1>
[[!ChangePassword? &submitVar=`change-password` &reloadOnSuccess=`0` &successMessage=`Votre mot de passe a été changé` &placeholderPrefix=`cp.` &redirectToLogin=`1`  &validateOldPassword=`1` &validate=`nospam:blank` ]]
<p>[[$myLgnChangePassword]]</p>

Then I created a chunk (myLgnChangePassword) and I pasted this:
<div class="error">[[!+cp.error_message]]</div>
<p class="confirm">[[!+cp.successMessage]]</p>

<form class="form" action="[[~[[*id]]]]" method="post"> 
 
  <input type="hidden" name="nospam" value="" />
  <label for="password_old">Ancien mot de passe</label>
  <br />
  <input id="password_old" type="password" name="password_old" value="[[+cp.password_old]]" />
  <br />
  <span class="error">[[!+cp.error.password_old]]</span>
  <br />

  <label for="password_new">Nouveau mot de passe</label>
  <br />
  <input id="password_new" type="password" name="password_new" value="[[+cp.password_new]]" />
  <br />
    <span class="error">[[!+cp.error.password_new]]</span>
  <br />
 
  <label for="password_new_confirm">Confirmer le nouveau mot de passe</label>
  <br />
  <input id="password_new_confirm" type="password" name="password_new_confirm" value="[[+cp.password_new_confirm]]" />
  <br />
   <span class="error">[[!+cp.error.password_new_confirm]]</span>
  <br />
  <input type="submit" name="change-password" value="Changer" />
</form>
 


Then, now even if it works, I wondering why it was not working before, but first why it does not work when we a re logged into Manager?]]>
pierrot1010 Feb 05, 2012, 02:32 AM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-410626
<![CDATA[Re: Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-400275
&reloadOnSuccess=`1`
, placeholder
[[+cp.successMessage]]
is not returned. Success is indicated via ?logcp-success=1 in the URL.

I am using
[[!If? &subject=`[[!getUrlParam? &name=`logcp-success` &int=`1`]]` 
       &operator=`EQ` 
       &operand=`1` 
       &then=`<span class="SuccessMsg">Your Password has been changed</span>`
]]
]]>
cp@pcs Nov 16, 2011, 05:01 PM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-400275
<![CDATA[Re: Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-395351
-sean]]>
sean69 Sep 30, 2011, 08:45 AM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-395351
<![CDATA[Re: Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-395311
As far as
[[!+cp.error_message]]
goes, each of the 3 fields in the form are validated independently and the appropriate error messages are displayed with them, so I don't see a need for it in my form.

The LoginChangePasswordController function for producing the successMessage is:
    public function setSuccessMessagePlaceholder() {
        $placeholderPrefix = $this->getProperty('placeholderPrefix');
        $this->modx->setPlaceholder($placeholderPrefix.'passwordChanged',true);
        $successMessage = $this->getProperty('successMessage');
        if (!empty($successMessage)) {
            $this->modx->setPlaceholder($placeholderPrefix.'successMessage',$successMessage);
        }
    }


So...
[[!+cp.successMessage]]
should in fact work.

I have also tried other ways to display the success message, none of them work.
I thought about using an input filter to process $_GET, but input filters are undocumented.
I have tried using the returned $_GET value IE: /pwdchange.html?logcp-success=1.

In fact, I have tried all of these and none evaluate to TRUE.
  [[!+cp.successMessage:notempty=`<p class="success">1</p>`]]
  [[!+cp.logcp-successMessage:notempty=`<p class="success">2</p>`]]
  [[!+cp.logcp-success:notempty=`<p class="success">3</p>`]]
  [[!+logcp-successMessage:notempty=`<p class="success">4</p>`]]
  [[!+logcp-success:notempty=`<p class="success">5</p>`]]
  [[!+cp.passwordChanged:notempty=`<p class="success">6</p>`]]


It is important that users receive this message confirming the password was changed.

Is there a way to dump all placeholders with a specific prefix? IE cp.*
]]>
cp@pcs Sep 30, 2011, 03:22 AM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-395311
<![CDATA[Cannot display password changed success message...]]> https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-394706
Here is my source, everything works BUT the cp.successMessage& cp.error_message placeholders... any thoughts??

[[!ChangePassword?
	&successMessage=`<div class="inline-success">Password changed successfully.</div>`
	&submitVar=`change-password`
	&placeholderPrefix=`cp.`
	&validateOldPassword=`1`
	&validate=`nospam:blank`
]]



[[!+cp.error_message]]
[[!+cp.successMessage]]

<form class="form" action="[[~[[*id]]]]" method="post" name="change-password" >
	<ul class="user-form change-password">
		<li>
			<input type="hidden" name="nospam" value="" />
			<label for="password_old">Old Password  </label>
			<input type="password" name="password_old" id="password_old" value="[[+cp.password_old]]" />
			[[!If? &subject=`[[!+cp.error.password_old]]` &operator=`!empty` &then=`<span class="error">[[!+cp.error.password_old]]</span>` ]]
		</li>
		<li>
			<label for="password_new">New Password </label>
			<input type="password" name="password_new" id="password_new" value="[[+cp.password_new]]" />
			[[!If? &subject=`[[!+cp.error.password_new]]` &operator=`!empty` &then=`<span class="error">[[!+cp.error.password_new]]</span>` ]]
		</li>
		<li>
			<label for="password_new_confirm">Confirm New Password  </label>
			<input type="password" name="password_new_confirm" id="password_new_confirm" value="[[+cp.password_new_confirm]]" />
			[[!If? &subject=`[[!+cp.error.password_new_confirm]]` &operator=`!empty` &then=`<span class="error">[[!+cp.error.password_new_confirm]]</span>` ]]
		</li>
		<li>
			<button type="submit" name="change-password" value="Change Password" class="change-password"><span>change password</span></button>
		</li>
	</ul>
</form>
]]>
sean69 Sep 24, 2011, 02:17 PM https://forums.modx.com/thread/70546/cannot-display-password-changed-success-message#dis-post-394706