Okay, I need to fetch the value from another page based on options that are selected, then adjust the max value on my slider to match the value retrieved from the function...
savvy?
Any help would be appreciated, I am currently using an alert() to show I am getting the right value, and it is working properly, I just have no idea how to use it outside of the function to set the other value
<script>
$(function() {
$("#slider").slider({
value:0,
min: 0,
max: 500, // ***** THIS VALUE ***** //
step: 1,
slide: function(event, ui) {
$("#amount").val(ui.value); // display number of slider value selected
}
});
$("#amount").val($("#slider").slider("value"));
});
function ajaxItNow() {
var date_val = document.getElementById("datepicker").value; // date
var time_val = document.getElementById("scheduleTime").value; // time
var cate_val = document.getElementById("category").value; // category chosen
var zone_val = document.getElementById("region").value; // region chosen
$.get("fetch.php", { date: date_val, time: time_val, category: cate_val, zone: zone_val })
.done(function(data) {
alert("Data Loaded: " + data); // say data value = 317, then i want to set max to 317
});
}
</script>