Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup windows in Web Part

Status
Not open for further replies.

cyrus71

Programmer
Feb 6, 2006
34
SE
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>"));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top