RequiredFieldValidator Problem
-
I have created a form using a panel. The form contains several textboxes and labels (name of the fields) and also three buttons (first one: Insert, second one: Reset, third one: Cancel). I have also added one RequiredFieldValidator on one of the textboxes which is the primary key. When I write something on the textboxes except required filed (that has RequiredFieldValidator) then I pressed Reset it gives shows me the message of RequiredFieldValidator or even when I pressed Cancel it gives me the same thing. How can I handle this (means when pressing Reset it will reset all the fields without showing the message and when pressing Cancel it will reset all the fields and make the panel invisible)? Thanks in advance for your help. Best regards,
-
I have created a form using a panel. The form contains several textboxes and labels (name of the fields) and also three buttons (first one: Insert, second one: Reset, third one: Cancel). I have also added one RequiredFieldValidator on one of the textboxes which is the primary key. When I write something on the textboxes except required filed (that has RequiredFieldValidator) then I pressed Reset it gives shows me the message of RequiredFieldValidator or even when I pressed Cancel it gives me the same thing. How can I handle this (means when pressing Reset it will reset all the fields without showing the message and when pressing Cancel it will reset all the fields and make the panel invisible)? Thanks in advance for your help. Best regards,
For the cancel and Reset button u can set the cause validation property to false so that when u click these button the required field validator will not be checked.By default cause validation property for all buttons will be set to true. So we have to change it. And for insert button the only way is you have to alternatively visible true or false, for the required field validator.
VanithaVasu