Validating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!,
I have Two Radiobuttons and a TextBox to write comments.
If RadioButton1 is on Comment must be entered in a textbox.
If RadioButton2 is on Comments are not necessary.

I am using the required field validator for textbox. But it's not working as i wanted. How can i write client script in this scenario. Anybody please help me how to write.

Thank You
Reddy
 
Reddy,
You need to show me the code, tehn probs i can help
you. But anyway what is the condition you write for
enabling the required validator?

Ajay
-----Original Message-----
Hi!,
I have Two Radiobuttons and a TextBox to write comments.
If RadioButton1 is on Comment must be entered in a textbox.
If RadioButton2 is on Comments are not necessary.

I am using the required field validator for textbox. But
it's not working as i wanted. How can i write client
script in this scenario. Anybody please help me how to
write.
 
This is not a job for the RequiredFieldValidator.

You need to write a CustomValidator that checks the status of the
RadioButton and then the status of the TextBox.

Create a client-side JavaScript function in the .aspx page and tell your
CustomVaildator control that this is the function to use. You'll also need
to create a similiar server-side vb sub for the validation controls
servervalidate event.




Reddy said:
Hi!,
I have Two Radiobuttons and a TextBox to write comments.
If RadioButton1 is on Comment must be entered in a textbox.
If RadioButton2 is on Comments are not necessary.

I am using the required field validator for textbox. But it's not working
as i wanted. How can i write client script in this scenario. Anybody please
help me how to write.
 
Back
Top