0

当弹出窗口出现时,有没有办法在 url 上添加选择结果?选择结果给出了选定框的值,我想将选定的值传递给表单,但我没有使用表单。我可以使用 url 传递值吗?

我想添加选定的值,如 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/

提前致谢​</p>

4

1 回答 1

0

将值附加到查询字符串。基本思路:

window.open ("form.php?foo=" + bar,"mywindow"...
于 2012-06-13T19:55:04.453 回答