Carlos, neither of them  are working. There is no redirect so
session.flash won't work. I'm using AJAX to submit n get response for
this form. I confirmed that response.flash indeed has the "Password
Updated" value by printing it to the console but I just don't see it
in the browser. What might I be doing wrong here?

Take a look at this in the view ::

<script>
 $('#TargetDiv2 form').bind('submit', function(){
   url="{{=URL(r=request, f='settings')}}";
   ids = ['no_table_old_password', 'no_table_new_password',
'no_table_new_password2'];
   ajax(url, ids, 'TargetDiv2');
   return false;
 });
</script>

<h2 class="form_title">Change Password:</h2>
{{=LOAD('account', 'changePassword', ajax=True, target='TargetDiv2')}}


And here's my controller:

def changePassword():
  next = URL(r=request,c ='account', f='settings')
  change_password =
auth.change_password(onaccept=changePasswordStatus)
  return change_password

def changePasswordStatus(change_password):
  response.headers.update({('web2py-component-
command'):"document.location='%s'"%next})
  response.flash = "Password Updated"
  session.flash = "Password Updated"

On Feb 24, 9:18 pm, Carlos <[email protected]> wrote:
> Hi Abhinav,
>
> Instead of response.flash, for redirections try session.flash.
>
>    Carlos

Reply via email to