Strange Validator Behavior Problem and Question

N

needin4mation

I added this to my javascript:

if (chkActive.checked==true)
{
ValidatorEnable(frval_DdlInactive, false);
ValidatorEnable(val_datIntacive,false);

}

If my checkbox is true I want to turn off a couple of validators. It
works fine and the page submits and updates my database.

The odd thing is that when the page returns from posting it jumps down
to the validators above and shows the error message from the validator
frval_DdlInactive:

<asp:RequiredFieldValidator id="frval_DdlInactive" runat="server"
ErrorMessage="Who made this inactive?"
ControlToValidate="ddlInactiveBy" InitialValue="Select
Staff"></asp:RequiredFieldValidator>

Everything works, but it appears to the user there was an error. I
cannot see why it would say there was a validator error *after* the
page postback. Also, the second validator does not comeback like this
one. Can you help? Thanks.
 
B

Bruce Barker

you need to duplicate the disable code on the server side as the serverside
also performs validation (client side is optional).

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top