1

I have a little problem with the validation in one form the form is composed by two taqs. There is a "Save" button in each tap (is the same control for both) and saves the form info. there are validation controls in one tab but not in the second. When we try to save the info from the second tab, and the info has not been filled in the first tab, the validators fire, and nothing happends, but because this validators are shown in the other tab, the end user might be thinking that the operation has been completed, instead, I would like to show a msgBox telling the user about the errors in the other tab. How do I know that the validators in the other tab have been fired, and display the error message when the button is clicked?

1
  • How are you implementing the tabs - Are they client-side generated tabs with JavaScript or do you have a asp.net multiview or wizard control or some other custom tab user control? Is the page posted back when switching between tabs? Commented May 11, 2009 at 11:09

2 Answers 2

1

You should use the ValidationGroup of your validator controls and the appropriate submit button. You can also use a ValidationSummary control which displays a summary of the validation messages - this can be set to display a message box if you want by setting the property ShowMessageBox=true.

Sign up to request clarification or add additional context in comments.

Comments

0

taqs - tap

dear why are you so confused?

All the validators are posted to the page as JavaScript functions. You can call the validation function on button's click and take the appropriate action.

You can use on buttons

onClientClick="Page_ClientValidate();"

2 Comments

thanks man, that is what i was looking for. It worked perfectly,I apreciate your help mate!!
@Javier it feels great when I can help some fellow programmer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.