×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

here's some of my code used. please modify it to match your case....

本文发表在 rolia.net 枫下论坛//please change the code acording to your request....

//1) in the first screen, use this function, ur first page should have the fild "comments" in the form firstpageform

var PickerHandle = null;

function SelectionOpen(Name, Request, ExtraParameter) {
if (PickerHandle && !PickerHandle.closed) {
alert("Please close the other window before opening this one.");
PickerHandle.focus();
} else {

var PickerDateScreenFormat = "dependent=yes,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,width=625,height=550";
if (typeof(ExtraParameter) == "undefined") {
ExtraParameter = true;
}
PickerHandle = window.open("second.html, "_blank", commentsScreen);

//Window is now open. Waiting for a input to save the selection.
}
}


//2) in the second screen us this function,you have to have the comments input field in the secondpageform


/**************************************************/
function PrepareSave() {
if (opener.closed) {
alert("Warning: Can't save selected item since the request main window is not available.");
window.close();
} else {
var comments = document.secondpageform.comments;
var Anchor = opener.DateStartAnchor;
var Hidden = opener.document.firstpageform.comments;

if (Anchor) {
Anchor.innerText = "some data";
}
Hidden.value = comments.value;

if (Hidden.type == "text") {
Hidden.fireEvent("onchange");
}

opener.focus();
window.close();
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / javascript 求助 pop up window
    有一个survey form.
    十个问题,每个问题有strongly agree, agree... disagree, strongly disagree 等几个radio button
    要求 当用户点击 disagree and strongly disagree 时,跳出一个POP UP window, user can input comment. 该怎么写?小窗口的值如何传到大窗口呢
    谢谢帮助
    • 打开window用window.open(); "小窗口的值传到大窗口", 用form, post.
      • 别搞的这么复杂, 就是用prompt 函数.
    • here's some of my code used. please modify it to match your case....
      本文发表在 rolia.net 枫下论坛//please change the code acording to your request....

      //1) in the first screen, use this function, ur first page should have the fild "comments" in the form firstpageform

      var PickerHandle = null;

      function SelectionOpen(Name, Request, ExtraParameter) {
      if (PickerHandle && !PickerHandle.closed) {
      alert("Please close the other window before opening this one.");
      PickerHandle.focus();
      } else {

      var PickerDateScreenFormat = "dependent=yes,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,width=625,height=550";
      if (typeof(ExtraParameter) == "undefined") {
      ExtraParameter = true;
      }
      PickerHandle = window.open("second.html, "_blank", commentsScreen);

      //Window is now open. Waiting for a input to save the selection.
      }
      }


      //2) in the second screen us this function,you have to have the comments input field in the secondpageform


      /**************************************************/
      function PrepareSave() {
      if (opener.closed) {
      alert("Warning: Can't save selected item since the request main window is not available.");
      window.close();
      } else {
      var comments = document.secondpageform.comments;
      var Anchor = opener.DateStartAnchor;
      var Hidden = opener.document.firstpageform.comments;

      if (Anchor) {
      Anchor.innerText = "some data";
      }
      Hidden.value = comments.value;

      if (Hidden.type == "text") {
      Hidden.fireEvent("onchange");
      }

      opener.focus();
      window.close();
      }
      }更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • I'll try, thanks a lot!