0

Hi I am calling the following javascript when user clicks complete button which is to call validation on all of the validation groups which i have 3. but what is happening is that only the validation summary for the Photos one is being displayed when the others should also be showing. Can anyone help?

function EnsureValidation() {
        Page_ClientValidate('PropertyInformation');
        Page_ClientValidate('MarketCondition');
        Page_ClientValidate('Photos');
}
Somedeveloper
  • 817
  • 2
  • 14
  • 31

2 Answers2

4

See Page_ClientValidate() with multiple ValidationGroups - how to show multiple summaries simultaneously?

Edit

Can't you just call Page_ClientValidate() (without any arguments) to validate all controls on the page?

Community
  • 1
  • 1
mellamokb
  • 56,094
  • 12
  • 110
  • 136
  • 1
    i cant use the Page_ClientValidate() because this causes all of the validation summaries to be displayed with all of the validation errors in them. i.e. validation summary with validationgroup=PropertyInformation will also show up errors from the MarketCondition validation group and vice versa. the link you gave me allowed me to fix the issue perfectly. thanks Niall. – Somedeveloper Feb 25 '11 at 16:35
0

I know this is an old post, The issue with using only Page_ClientValidate() is that, if you want to validate one group at a time, it won't work as it fires all the validation groups, you can do something like this,

function something(){
  if(Page_ClientValidate('Save'))
  {
     //Your Code
  }
  else if (Page_ClientValidate('Group2'))
  {
     //your code
  }
  else
  {
     //your code
  }
};
kas_miyulu
  • 335
  • 1
  • 5
  • 27