From: Ujjaval S. <uj...@gm...> - 2006-03-20 08:21:18
|
Hey all, I have a webform created using Anthem controls. I have got textboxes and dropdownlists. I was wondering, what is the best way to validate the controls while using Anthem. Does the standard ASP .NET controls work just fine?? I have got javascript file for validations which I can use where on button click event, all validation occurs. But somehow my javascript is not working properly and so as my form. What I have done is like this, during the page load, I am adding an attribute for textbox as " txtbox1.Attributes.Add("required","yes");" to have the validation for the value required. At the end, on the submit button, I have added this attribute: "btn_submit.Attributes.Add("onClick","validate(document.Form1); return document.formSubmit");" where validate() is the function in my javascript which scans through all the form elements and look for the attribute like "required" as set in my textbox above. Now, my submit button has two states: 1. Ok, 2. Update. before I used validators, it worked fine because there was not javascript. But because of the javascript, somehow, it just keeps calling my button click event which should only occur once at a time. Any ideas on this?? Any better idea to perform validations on forms with Anthem controls.? Thanks in advance, Ujjaval -- Ujjaval Suthar Mobile : +61 - 0431 152 757 |