View Single Post
  #2 (permalink)  
Old 02-26-2007, 01:16 PM
pshah pshah is offline
Zimbra Employee
 
Posts: 269
Default AjxPost?

There is a class called AjxPost in the toolkit that might be of use for you. Basically create a new instance of this class passing in an IFRAME which will handle the posting to the server without forcing the browser to navigate away.

You then call execute passing in a callback function and the FORM element. Pretty simple.

Here's some example code:

Code:
  var iframe = document.createElement("IFRAME");
  var post = new AjxPost(iframe);
  var callback = new AjxCallback(this, this._myCallback);
  var form = document.getElementById("myFormId");
  post.execute(callback, form);
When the client successfully posts the form data to the server, "_myCallback" will get called so you can finish processing whatever. If the server returns an error, the callback method will contain the error code.

HTH.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote