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

[Solved] Slider region margins

2 Answers 109 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Dimo
Top achievements
Rank 1
Dimo asked on 19 Feb 2010, 05:05 PM
HI!
I want to get the values of RadSlider range in client side (on onClientValuechanged) and to set this values to simple input text fields.
How is possible to do this crossbrowser?

2 Answers, 1 is accepted

Sort by
0
Dimo
Top achievements
Rank 1
answered on 21 Feb 2010, 05:55 AM
function OnClientValueChanging(sender, args) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Show the tooltip only while the slider handle is sliding. In case the user simply clicks on the track of the slider to change the value<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the change will be quick and the tooltip will show and hide too quickly.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!isSliding) return;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var tooltip = $find("&lt;%= RadToolTip1.ClientID %&gt;");<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tooltip.set_text(args.get_newValue() );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.forms[0].txtSelectionStart.value = sender.get_selectionStart() ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.forms[0].txtSelectionEnd.value =&nbsp; sender.get_selectionEnd() ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> 

Could I use one OnClientValueChanging procedure for few sliders in one page, and to determinate in it which is the name of the caller slider, to assign the slider values to different text field on the client, but without using server-side execution, only on the client, using javascript?
0
Tsvetie
Telerik team
answered on 22 Feb 2010, 06:27 PM
Hi Dimo,
You can check which slider raised the event the following way:
<telerik:RadSlider ID="RadSlider1" runat="server" OnClientValueChanging="OnClientValueChanging">
</telerik:RadSlider>
 
<script type="text/javascript">
function OnClientValueChanging(sender, args)
{
    alert(sender.get_id());
}
</script>

Kind regards,
Tsvetie
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Slider
Asked by
Dimo
Top achievements
Rank 1
Answers by
Dimo
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or