
Passing value from select box to next page
Hello all. I am playing with my Internet Explorer 6 and its context menu. I
am trying to insert a value from a select box into the url leading to the
next page, but I am doing something seouriously wrong. The first value
(sUrl) is passed from the original document and is causing no problem
(external.menuArguments is Internet Explorer 5+ I think), but I don't know
how to pass the "listValue" value from the select box. I know the value is
there because I can see it in the alert box. Should I try to submit the form
instead?
Here is my code:
terje
var oWin = window.open("", "linkdownloader",
"toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes
, resizable=yes, top=0, left=0, width=200, height=400");
--
var sUrl = external.menuArguments.document.URL
--
oWin.document.writeln ("<form name=\"MyForm\"><select id=\"MyList\"
name=\"MyList\" size=\"1\">");
oWin.document.writeln ("<option value=\"1\">1");
oWin.document.writeln ("<option value=\"2\">2");
oWin.document.writeln ("</select></form>");
--
oWin.document.writeln ("<script language=\"javascript\"
type=\"text/javascript\">");
oWin.document.writeln ("function myFunction(){");
oWin.document.writeln ("var listValue = document.MyForm.MyList.value");
oWin.document.writeln ("alert(listValue) }");
oWin.document.writeln ("<\/script>");
--
oWin.document.writeln ("<a href=\"NextPage.html?Url=" + sUrl + "&S=" +
listValue + " onClick = myFunction();>Next page</a>");