當彈出窗口出現時,是否有方法在url上添加select-result?選擇結果給出了所選框的值,並且我想將選定的值傳遞給表單,但我不是用表單。我可以傳遞網址的值嗎?如何使用javascript將值添加到url var
我想補充的選定值就像form.php的?ID = 2882,222,22412,23
$(function() {
$(".selectable").selectable({
filter: "td.cs",
stop: function() {
var result = $("#select-result").empty();
var result2 = $("#result2");
$('.ui-selecting:gt(31)').removeClass("ui-selecting");
confirmation($(".ui-selected").length + " box selected. " + ($(".ui-selected").length));
function confirmation() {
var answer = confirm($(".ui-selected").length + " box selected. " + ($(".ui-selected").length));
if (answer) {
window.open("form.php", "mywindow", "menubar=no,resizable=no,width=650,height=700");
}
else {}
}
$('#divmsg').html($(".ui-selected").length + " box selected")
$('#divmsg2').html($(".ui-selected").length)
if ($(".ui-selected").length > 90) {
alert("Selection of only 90 boxes allowed");
$('#divmsg').html($('#divmsg').html() + ",<br><b>Message: Selection of only 90 pixels allowed!!</b>");
$(".ui-selected").each(function(i, e) {
if (i > 3) {
$(this).removeClass("ui-selected");
}
});
return;
}
$(".ui-selected", this).each(function() {
var cabbage = this.id + ', ';
result.append(cabbage);
});
var newInputResult = $('#select-result').text();
newInputResult = newInputResult.substring(0, newInputResult.length - 1);
result2.val(newInputResult);
}
});
});
這是小提琴http://jsfiddle.net/dw6Hf/57/
我曾嘗試
窗口。打開(「form.php?id =」+ select-result,「mywindow」,....
但它不會工作!!任何想法??? 在此先感謝
像'document.location.hash'可能? –
我該如何使用它? – user1421432
'document.location.hash = variable;' –