我使用的是noUiSlider,我试图通过表单将滑块的值传递给mysql数据库。表单运行良好,并将其发送到数据库,但滑块的值与其最初的起始值没有变化。我已经尝试了几乎每一个可能的角度,我可以想到和研究到处,我只是不知道我做错了什么。请看一看,让我知道问题出在哪里。对那个让我开诚布公的人表示敬意。谢谢。
$("#rangeSlider").noUiSlider({
start: 7000,
step: 1000,
behaviour: 'snap',
connect: 'lower',
range: {
'min': 0,
'max': 15000
},
serialization: {
lower: [
$.Link({
// Place the value in the #value element,
// using the text method.
target: $("#value"),
method: "text",
format: {
decimals: 0,
thousand: ',',
prefix: '£'
}
}),
],
},
change: function(event, ui) {
$('#amount').val('#rangeSlider', ui.value);
}
});
$( "#amount" ).val( "£" + $( "#rangeSlider" ).val() );发布于 2014-06-10 15:47:48
Ok终于解决了它:)
$("#rangeSlider").noUiSlider({
start: 7000,
step: 1000,
behaviour: 'snap',
connect: 'lower',
range: {
'min': 0,
'max': 15000
},
serialization: {
lower: [
$.Link({
// Place the value in the #value element,
// using the text method.
target: $("#amount"),
type: "post"
}),
$.Link({
// Place the value in the #value element,
// using the text method.
target: $("#value"),
method: "text",
format: {
decimals: 0,
thousand: ',',
prefix: '£'
}
}),
],
},
});这将向数据库发布答案,并在滑动滑块时显示滑块的值:)
https://stackoverflow.com/questions/24143889
复制相似问题