Quote:
|
Originally Posted by svgiles
I am trying get a button to open a pop-up window from within and ASP response.write statement. I need to have it open this way because it is part of a larger "if..then..else" statement.
It will not respond. Is this possible?
The code looks like this:
response.write("<input name='deletebutton' type='button' onClick='window.open('insert_pic_show.asp','',widt h=500,height=400,left=250,top=75,scrollbars=yes,sc reenX=0,screenY=100')' value='Picture Deletion' >")
Any help would be immensely appreciated!!
Steve
|
The problem is the use of single quotes in the onClick attribute, because the Javascript doesn't know what do when it encounters the other single quotes. The Javascript thinks the script ends at the second pair of single quotes, which obviously isn't what you intended, and it causes an error.
Code:
response.write "<INPUT type=""button"" value=""Picture Deletion"" onClick=""window.open('insert_pic_show.asp','mywindow','width=500,height=400,left=250,top=75,scrollbars=yes,screenx=0,screenY=100')"">"