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

How to validate a slider

1 Answer 110 Views
Slider
This is a migrated thread and some comments may be shown as answers.
viscious
Top achievements
Rank 1
viscious asked on 16 Jul 2008, 12:04 AM
I have a survey page. basically there are like 40 questions, each question can be answered with a numerical value of 1 through 6.  We are using sliders to let people choose the answer to each question.

I would like to use something like an <asp:RequiredFieldValidator /> to make sure the user chooses a value between 1 and 6.

What we have actually done is set the minvalue on the slider to 0 and max value to 6, but we are considering a selection of 0 as a question that hasn't been answered.  So basically I need to use a validation control to validate that the slider value is not 0.  I need it to work like the builtin validation controls work, with a validation group, and client and server side validation support. 

I know that I could set the slider range to 1 - 6, and then I could guarantee that I won't get any 0 values.  But that is not an acceptable solution, we don't want people to select the default value, we want them to explicilty choose a value.

Is there anyway to do what I am asking for?  The slider doesnt even have the standard ValidationGroup property.






1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 16 Jul 2008, 01:30 PM
Hello viscious,

Having a validation for RadSlider is in our ToDo list for one of the following versions of the control. For the time being, we can suggest to use a custom validator that would make the check on the server. For convenience I attached a small sample that shows this approach in action.



Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Slider
Asked by
viscious
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or