Found it...
I just did a call like this.
on_success="alert(http_request.status)",
on_failure="alert(http_request.responseText)",
Sorry for bothering you.
-fred-
On Mar 13, 2007, at 9:31 AM, Fred C wrote:
>
> Hi
>
> I have two questions on how to use remote form
>
> First, how and where can I get the data returned be update_info?
> Since the call, on_complete, on_success, etc, etc doesn't take any
> arguments.
>
> Second question, how can I get the falure code. I would like to
> redirect users on the login page when the login session is expired.
> Now I just get an alert window with just 403 error.
>
> Thanks for your suggestions.
> -fred-
>
>
>
> info_form = RemoteForm(fields=InfoFields(),
> action="/profile/update_info",
> submit_text = 'Save',
> before="show_wheel();",
> on_complete="show_status();",
> on_success="alert('on_success')",
> on_failure="alert('on_failure')",
> confirm="Save your changes?")
>
> ....
>
> @expose(format='json')
> @identity.require(identity.not_anonymous())
> def update_info(self, *args, **kw):
> try:
> user = User.by_user_name(identity.current.user_name)
> except:
> flash("Error while reading you information")
> return {}
>
> ... some more stuff done hiere ...
>
>
> return dict(status=0)
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---