[jQuery] trouble with post function
Hello. I've had this trouble all night and I can fix it.... I am using
the code below and if I take away the arguments I want to pass, then
it works fine and I get a result back from the script. However, when I
try to pass the form values and the slider values (from the UI slider)
to the script the callback function never executes. Anyone know why?
$("#slider").slider({
value:6,
min: 1,
max: 6,
step: 1,
change: function(event, ui) {
$("#environment").val(ui.value);
var bensinp = $("input[name=bensin]").val();
var biogasp = $("input[name=biogas]").val();
var dieselp = $("input[name=diesel]").val();
var e85p = $("input[name=e85]").val();
var naturgasp = $("input[name=naturgas]").val();
var rapsbränslep = $("input[name=rapsbränsle]").val();
var envv = $("#slider2").slider("value");
var pric = $("#slider").slider("value");
$.post("rankfuels.php", {
bensin : bensinp,
biogas : biogasp,
diesel : dieselp,
e85 : e85p,
naturgas : naturgasp,
rapsbränsle : rapsbränslep,
environment : envv,
price : pric
}, function (data) {
$("#fuelranking").html(data);
});
}
});