Requiredfieldvalidator not validating

Posted by / 11-Sep-2017 20:44

Have a look at this BN -------------------------------------- Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. I haven't gone thru your code yet but heres what I have to say. The Validation Group name on the button does not match the Validation Group name on the validator. There is a javascript error on the page causing problems to the client-side validation system. You have yet to setup server side validation, which is required and defends against inputs when the browser fails to do its job. Is Valid is true in the button's Click method before saving. See my article for more on this and other common validation issues: So if you attach a Required Field validator, it will always act, even you control is hidden. You have to set the Last Name's Causes Validation property to false when its hidden. So in this case, it must be set to Initial Value="".

In case of a text box - when you load your page if the textbox is blank you tell the required field validator that the initial/default value of textbox is "".

If you want to trigger the validation of the enitre page before submit you can do so be calling Page_Client Validate method var is Page Valid = false; is Page Valid = Page_Client Validate('Validation Group Name'); //Validation Group Name - this is an optional parameter if you want to validate only a group of validators if (is Page Valid) //the above is Page Valid = Page_Client Validate('Validation Group Name'); can be called as is Page Valid = Page_Client Validate(); i.e.

with out parameter would validate all validation control on screen.

I went ahead and removed the alert notification from the button. If I have Enable Client Script="true", shouldn't the validation still fire client side?

Selected Index = 0 Rebind_Data Lists() pnl Data Found. Visible = False Update_Labels() End If End Sub That didn't do it.

requiredfieldvalidator not validating-56requiredfieldvalidator not validating-61requiredfieldvalidator not validating-82

I had to set the Initial Value of the validator to '-1' in order to correct an earlier problem which can be found in the short post: I kinda didn't understand what you exactly wanted to do in your other thread. Tell me if I'm wrong, but from reading your posts it sounds like you have a Drop Down List, that when the selected item is "Enter New" you give the user the opportunity to enter a name... This way, you do not have to set Causes Validation of each control. Selected Value = "Enter New" Then 'show input fields div1.