Hi,
I am trying to show a file in a new window by clicking on a Button when you write the file name in a usual html text control.
I wrote following code in RenderWebPart(...) but it does not work, it opens new window but i get error: the page not found 404 error. i tested if i the javascript function get right value from the text control, but the function gets a string (text1.value) not the value.
output.Write(ReplaceTokens("\n"
+ " <form id=\"form1\">"
+ " <input id=\"Text1\" type=\"text\"/>"
+ " <input id=\"Button1\" type=\"button\" value=\"visa\" onclick=\"ShowMe('document.forms[0].Text1.value')\"/>"
+ " <input id=\"label1\" type=\"label\" />"
+ " </form>"
+ "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<!-- \n"
+ " function ShowMe(URL)\n"
+ " {\n"
+ " document.forms[0].label1.value=URL;"
+ " window.open(URL, \"mywindow\", \"width=800,height=700,resizable=yes\");"
+ " }\n"
+ "//-->\n"
+ "</script>"));
I am trying to show a file in a new window by clicking on a Button when you write the file name in a usual html text control.
I wrote following code in RenderWebPart(...) but it does not work, it opens new window but i get error: the page not found 404 error. i tested if i the javascript function get right value from the text control, but the function gets a string (text1.value) not the value.
output.Write(ReplaceTokens("\n"
+ " <form id=\"form1\">"
+ " <input id=\"Text1\" type=\"text\"/>"
+ " <input id=\"Button1\" type=\"button\" value=\"visa\" onclick=\"ShowMe('document.forms[0].Text1.value')\"/>"
+ " <input id=\"label1\" type=\"label\" />"
+ " </form>"
+ "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<!-- \n"
+ " function ShowMe(URL)\n"
+ " {\n"
+ " document.forms[0].label1.value=URL;"
+ " window.open(URL, \"mywindow\", \"width=800,height=700,resizable=yes\");"
+ " }\n"
+ "//-->\n"
+ "</script>"));