ToString1
asked on
Set jquery slider value in code
I have implemented wizard steps in MVC and am trying to use a jquery slider to advance on step as you progress through wizard.
I am providing the total number of questions and the current question via hidden values.
For some reason the slider is not progressing;
<script type="text/javascript">
var i = $('input[name=NumberTotal]
var x = $('input[name=ThisNumber]'
$(function() {
$("#slider-range-max").sli
range: "max",
min: 1,
max: i,
value: x,
slide: function(event, ui) {
x = ui.value
}
});
$("#question").val($("#sli
});
</script>
Why is this not working?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Forgot to say
I am loading new view each time I click wizard step so it is refreshed every time
I am loading new view each time I click wizard step so it is refreshed every time
ASKER
I tried your solution but I did not get an alert popup
Then maybe
var i = $('input[name=NumberTotal] ').val();
and
var x = $('input[name=ThisNumber]' ).val();
are not getting the values you think they'd get? Have you tried to alert them on every step of the wizard to check that the values are being correctly passed to the slider?
var i = $('input[name=NumberTotal]
and
var x = $('input[name=ThisNumber]'
are not getting the values you think they'd get? Have you tried to alert them on every step of the wizard to check that the values are being correctly passed to the slider?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
I am definately getting the values from the hidden inputs on the view and the code is correct hmm..
I am definately getting the values from the hidden inputs on the view and the code is correct hmm..
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your replies. Yes I am using 1.8 or above
Could you provide a code snippet?
I want the slider to be moved by code and not allowed by mouse
Thanks