Guest User

Untitled

a guest
Mar 26th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dojo.connect(form, "onsubmit", function(event){
  2.     dojo.stopEvent(event);
  3.  
  4.     var digit_form = dijit.byId("user_profile_form");
  5.     if (!digit_form.validate()) {
  6.         return false;
  7.     }
  8. //  client-side validation is ok, so we submit form using AJAX
  9.  
  10.     var xhrArgs = {
  11.         form: form,
  12.         handleAs: "json",
  13.         load: function(responseText){
  14.             // here I get response from server
  15.             // and if there are errors on server
  16.             // responseText object contains array with errors, so I
  17.             // need to show this errors to user
  18.         },
  19.         error: function(error) {
  20.         }
  21.     }
  22.  
  23.     var deferred = dojo.xhrPost(xhrArgs);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment