hi
I have added the slider Myslider1 to an MVC .cshtml page, but the goal is to “connect” the value with a textbox that represents a model value. So if the cshtml is
Linking Slider to Object
The slider can be linked to some objects on page. In this case, the linkTo() method is used. The slider can be linked to:
An HTML input;
An HTML textarea;
An HTML select;
Any HTML container tag.
mySlider.linkTo(objectId);
The example provided below shows the way how the slider can be linked to an HTML input:
But I am not able to link the mvc EditorFor() variable.
@Html.EditorFor(model => model.PercentCycleComplete, new { @id = "PCC" })
and then
[code] function doOnLoad() {
var mySlider = new dhtmlXSlider({
parent: "sliderObj",
size: 350,
value: 50,
step: 1,
min: 0,
max: 100
});
mySlider.linkTo("PCC");
};[/code]
Now when i mistakenly used the MVC’s labelFor variable? it linked up, but took the label away, it will not link with the editorfor
then i think ok, lets change it to textboxFor() ? and now its linked up, sort of.
they link but then it always defaults to the sliders default and ignores the value of the mvc from the database. so no matter what it is, its showing 50 (my default value)
Could you please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.