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

Pass parameter in

2 Answers 92 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Nigel
Top achievements
Rank 1
Nigel asked on 01 Oct 2007, 09:21 AM
Hi

I was hoping 
to use the slider control to set a number of lower and upper percentage value limits as part of a site I'm developing. I have a div for each slider and I'm using

function HandleValueChanged (sender, eventArgs)
{

$get("ll1").innerHTML = sender.get_Value();

}

to display value of the slider.

Rather than having a separate function to handle each sliders ValueChange and ClientLoaded event is it possible to pass in the id of the div into the function. I've tried one or two things but just keep getting JavaScript errors.

Like

function HandleValueChanged (sender, eventArgs, sliderDiv)
{

$get(sliderDiv).innerHTML = sender.get_Value();

}

??

Thanks

2 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 01 Oct 2007, 01:02 PM

Hello Nigel,

You can set div.id using the following convention:
RadSlider1_Div
RadSlider2_Div
.....
After that you should change the HandleValueChanged in the following way:

function HandleValueChanged (sender, eventArgs, sliderDiv)

    $get(sender.get_id() + "_Div").innerHTML = sender.get_Value();
}

I hope that this will help you.

Best Regards,
Petio Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nigel
Top achievements
Rank 1
answered on 01 Oct 2007, 02:10 PM
Thanks - that worked a treat!
Tags
Slider
Asked by
Nigel
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Nigel
Top achievements
Rank 1
Share this question
or