I have put a small sample together to work with WebTextEdit Boxes and WebSliders. I can change the value of the slider when the text box changes but I am not able to change the value of the WebTextEdit box when the slider value has changed.
What am I doing wrong? How do I access the text Edit Box from the slider call back.?
function wceNum1_TextChanged(oEdit, newText, oEvent) {
//Add code to handle your event here.//Get Current Value
var num1 = igedit_getById("wceNum1");
var val1 = num1.getValue();
// Update Slider Value
var slider = $find("<%= WebSlider1.ClientID %>");
slider.set_value(val1);
}
function SliderChanged(sender, e) {
var myval = sender.get_value();
//Update Num1 with value of slider
var mynum1 = $find("<%= wceNum1.ClientID %>");
mynum1.setValue(myval);
// HTML CODE
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<igtxt:WebCurrencyEdit ID="wceNum1" runat="server" MaxValue="1000" MinValue="1"
ValueText="50"> <SpinButtons Delta="10" Display="OnRight" />
<ClientSideEvents TextChanged="wceNum1_TextChanged" />
</igtxt:WebCurrencyEdit>
<br />
<cc1:WebSlider ID="WebSlider1" runat="server" MaxValueAsString="100" MinValueAsString="1">
<ClientEvents ValueChanged="SliderChanged" />
</cc1:WebSlider>
Hi,
To get reference to javascript object of WebNumericEdit, the igedit_getById should be used. So, in function SliderChanged you may fix it byvar mynum1 = igedit_getById("<%= wceNum1.ClientID %>");
Note: In function wceNum1_TextChanged, there is no need to use igedit_getById('wceNum1'), because the first param oEdit is already reference to that object. You may use
slider.set_value(oEdit.getValue());