If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Pop up window from Response.write statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-25-06, 03:37
svgiles svgiles is offline
Registered User
 
Join Date: Oct 2004
Posts: 10
Red face Pop up window from Response.write statement

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
Reply With Quote
  #2 (permalink)  
Old 04-25-06, 04:09
YeahWhat YeahWhat is offline
Registered User
 
Join Date: May 2005
Posts: 39
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')"">"
Reply With Quote
  #3 (permalink)  
Old 04-25-06, 22:07
svgiles svgiles is offline
Registered User
 
Join Date: Oct 2004
Posts: 10
Thank YOU!

Thank you, Yahweh!!!
Thank you very, very, very much!!!!!!!!!!!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On