How to validate a slider

2 posts, 0 answers
  1. viscious
    viscious avatar
    18 posts
    Member since:
    Aug 2006

    Posted 15 Jul 2008 Link to this post

    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.

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 16 Jul 2008 Link to this post

    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.

    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top