我有這樣的代碼:奇怪的行爲 - 連載
var sizes = ["1/9","1/8","1/7","1/6","1/5","1/4","1/3","1/2","1/1","2/1","3/1","4/1","5/1","6/1","7/1","8/1","9/1"];
var slider = new dijit.form.HorizontalSlider({
value:8,
name:"value"+[i],
slideDuration:0,
onChange:function(val){
dojo.byId('value'+[i]).value = sizes[val];
},
minimum:0,
maximum:sizes.length-1,
discreteValues:sizes.length,
intermediateChanges:"true",
},node);
現在,當我提出:
$("#custom").submit(function() {
var formdata = $("#custom").serializeArray();
$.ajax({
url: "insert.php",
type: "post",
dataType: "json",
data: formdata,
success: function(data) {
}
});
例如,如果我選擇值1/8被髮送至1,或9/1爲16
我要的是送分數值,即顯示在輸入框中,但正如我所說的,沒有被髮送到insert.php
任何想法?謝謝
嘗試'變種尺寸= [ 「1 \/9」, 「1 \/8」, 「1 \/7」];' – Rafay
@ 3nigma:我不那這將解決問題。 '/'通常不需要被轉義。根據OP的描述,如果「1/8」作爲1發送,「9/1」作爲16發送,那聽起來數組索引被髮送。 – darioo
@darioo你是對的我沒有閱讀'9/1'作爲16部分... – Rafay