This is a migrated thread and some comments may be shown as answers.

RadTextBox Validation when loss of focus

2 Answers 183 Views
Input
This is a migrated thread and some comments may be shown as answers.
gary
Top achievements
Rank 1
gary asked on 12 Aug 2010, 09:07 PM
Hi,

I am trying to add validation to a RadTextBox that will cause validation to occur when the text box loses focus.

The scenerio is: If a user uses the Tab key to move out of a text box that is a reuired field, I am trying to display an error message stating that the field is a required field. I tried using RequiredFieldValidator control, which works fine when user submits, and CustomValidator control setting setting ValidateEmptyText to true.

Is there a way that this can be done client-side without writing JavaScript? If JavaScript needs to be written, what are some of the key calls to make?

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 13 Aug 2010, 02:16 PM
Hello Gary,

Did you set the RequiredFieldValidator's Display property to Dynamic? Or when you load your page you can call Page.Validate("ValidationGroupName") to display the required fields when the page loads, so they know which fields are required.

I hope that helps.
0
gary
Top achievements
Rank 1
answered on 13 Aug 2010, 08:24 PM
Thanks...You have given me another way to accomplish my task.
Tags
Input
Asked by
gary
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
gary
Top achievements
Rank 1
Share this question
or