How to use Slider with MVC textbox where data parallels

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

  @Html.EditorFor(model => model.CyclePercentComplete)

then add:
$(“#Myslider”).OnChange ( function() {


when doing this, it has an infinite alert, hard to clear the browser even:

var mySlider, mySlider2;

	function doOnLoad() {
		mySlider = new dhtmlXSlider({
			parent: "sliderObj",
			size: 350,
			value: 50,
			step: 1,
			min:  0,
			max: 100

		mySlider.attachEvent("onChange", function (value) {


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.
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



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.

Here is a small guide how to make a complete demo: … pport.html

If you don’t want to share your demo here for any reasons - you can send it to, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to