[CLOSED] Ext.Net webforms validation summary

  1. #1

    [CLOSED] Ext.Net webforms validation summary

    Hi,

    I have a webform having ext.net controls seperated in different tabs. Each tab is rendered via a user control (.ascx) file.

    I would like to add a validation summary to display client side validation errors. The submit button automatically checks if there is any client side valiation error and prevents the form to be submitted. However, the controls are in different tabs so it is not easy to find where is the client side error.

    Is there anyway to iterate through all controls in the webform, check if it has an error and collect the error messages for those controls? Alternatively, if there is any existing validation summary control then it would be helpful too. I tried ValidationStatus plug-in but it only validates a single form while in my case there are multiple FormPanels within the web page.

    Update:-->

    I found a way to iterate through all Form Panel and check if it is valid or not.

    var ValidateForm = function () {
                var valid = true;
                var dom = Ext.getBody();
                Ext.each(Ext.get(dom).query('div.extFormPanel'), function (dom) {
                    var cmp = Ext.getCmp(dom.id);
                    if (cmp && cmp.isVisible()) {
                        valid = cmp.getForm().isValid() && valid;
                    }
                });
                return valid;
            }
    Is there anyway to get the error message as well?

    Many thanks.
    Last edited by Daniil; Nov 22, 2013 at 3:18 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi @Maitreya,

    A field's getErrors method should help you.
    http://docs.sencha.com/extjs/4.2.1/#...thod-getErrors
  3. #3
    Thanks Daniil. It has been very useful.

    Regards,
    Maitreya

Similar Threads

  1. [CLOSED] RowEditing Delay validation and position of error summary
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 13, 2012, 2:48 AM
  2. MVC vs WebForms
    By yash.kapoor in forum 2.x Help
    Replies: 2
    Last Post: Nov 02, 2012, 3:34 AM
  3. WebForms And MVC Support
    By dimi88 in forum Open Discussions
    Replies: 1
    Last Post: May 18, 2012, 5:32 PM
  4. [CLOSED] Question about MVC and webforms
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 29, 2011, 5:15 PM
  5. validation summary
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Mar 20, 2009, 1:20 PM

Posting Permissions