Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    10

    Red face Unanswered: 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

  2. #2
    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')"">"

  3. #3
    Join Date
    Oct 2004
    Posts
    10

    Thank YOU!

    Thank you, Yahweh!!!
    Thank you very, very, very much!!!!!!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •