Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7694271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:16:54+00:00 2026-05-31T21:16:54+00:00

I am using dojo forms and submitting using AJAX. I use 2 methods of

  • 0

I am using dojo forms and submitting using AJAX. I use 2 methods of validate: on client side and on server side:

dojo.connect(form, "onsubmit", function(event){
    dojo.stopEvent(event);

    var digit_form = dijit.byId("user_profile_form");
    if (!digit_form.validate()) {
        return false;
    }
//  client-side validation is ok, so we submit form using AJAX

    var xhrArgs = {
        form: form,
        handleAs: "json",
        load: function(responseText){
            // here I get response from server
            // and if there are errors on server
            // responseText object contains array with errors, so I
            // need to show this errors to user 
        },
        error: function(error) {
        }
    }

    var deferred = dojo.xhrPost(xhrArgs);
}

The problem is that validate() method shows nice error messages to user, but when I get errors from server I can’t show errors like method validate() does, so I use native javascript alert() method that is not so nice. I would like equal displaying of errors that validates on server and client side.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:16:55+00:00Added an answer on May 31, 2026 at 9:16 pm

    For each server side error, set a new widget.SSError property.

    error: function(error) {
        widget.set('SSError','The value is invalid because server thought so...'
        form.validate();
    }
    

    Override the widget.isValid() function and make it check the new widget.SSError property.

    Based on this message,

    var myCustomFS = dojo.declare(dijit.form.FIlteringSelect, {
        postMixInProperties: function() {
            this.inherited(arguments);
    
            // Point _isValidOld at the function isValid currently points at
            this._isValidOld = this.isValid;
    
            // Point isValid at a new function
            this.isValid = function() {
                if (this.SSError) {
                    return false;
                }
                return this._isValidOld(); // Calls the original isValid function
            }
        }
    };
    

    Put a watch on the value and reset widget.SSError when it changes.

    widget.watch('value', function(){
        widget.set('SSError', false)
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using dojo.xhrPost to sent Ajax Requests The call is wrapped by a function
Using a form in a dialog box I am using Dojo in jsp to
I'm trying to get a filtering select work with a Dojo enabled form using
I am using Dojo Toolkit and I want form elements to serialize into array,
When I post a form using dojo.xhrPost , I get all the fields in
I have an HTML form using dojo and have the following code for a
I'm using Dojo 1.5 to create a dijit.form.Select with some data from a datastore.
I am attempting to put together a fairly complex form using dojo and dijit
I'm trying to build a web app using Dojo. I have a form that
I am creating a Zend Form using Dojo elements and I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.