puja_suri 0 Newbie Poster

I m making a web application.In one of the page ,i have a submit button.On clicking of which the input will be validated and after dat if inputs are not corretc a dialog box need to be displayed.
Now my problem is how to implemet the dialog box.On soln which i know is to add attribute property of the button.But this wuld be done in the page_load event and dialog box will be displayed even if the inputs are correct,but i want that it shuld be display only on wronmg inputs .
How to do this.Pls guide me.
Thank u