Hi Michael.
I'm improving my script and I want to make it more "dynamic" and I need to do this thing :
Into the HTML code of the command's page I have this code :
code:
...
<tr>
<td colspan=3 id="maxlensliderContainer"><moi:Slider id="maxlenslider" min="0" max="200" style="width:100%" onmousemovevaluechange="doFilter();"/></td>
</tr>
<tr>
<td colspan=3 id="maxlenInputContainer"><moi:DistanceInput id="maxlen" style="width:6em;" default="1" binding="maxlenslider.value = this.value"/></td>
</tr>
Well. Now I need to dynamycally change the max="200" to assign it a value that I calculated inside the "function init() {...}".
I have tried many ways but nothing worked.
For example I tried something like this :
code:
...
function renderPage() {
maxLengthValue = 20; // I put here this statements only for example. maxLengthValue is calculated inside function init() {...}
document.getElementById("maxlensliderContainer").innerHTML =
"<moi:Slider id=\"maxlenslider\" min=\"0\" max=\"" + maxLengthValue + "\" style=\"width:100%\" onmousemovevaluechange=\"doFilter();\"/>";
return true;
}
</script>
</head>
<body onload="renderPage();" class="commandbody">
It seems that after executing that code the binding between the slider and the numeric input field (id="maxlen") doesn't work anymore.
(Assuming that my code at least changes in the correct way the "max=200" attribute of the slider...)
How can I do ?
Thanks for help!
I stay tuned.
Marco (mkdm)
|