Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    43
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Close Window Problem?

    Hi all , I am having a button , and if i click that a pop-up message should come up alerting " you are closing window" with yes and no buttons and well everybody knows if yes =close and no=stay .Now the problem is I am getting the popup displayed twice ..i,e even i press yes .. Iam getting a new pop asking the same question .How can this be avoided . I just need pop-up once..if i hit cancel it works fine .help plz

  • #2
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    How exactly are you closing the window? Can you post any code?

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    43
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Code:
    function closeMe(){
    var isConfirmed=confirm('do u want to close window')
    if(isConfirmed){
    self.close()
    }
    }  
    
    
    OnClientClick="closeMe()"

  • #4
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    use "onclick" not "OnClientClick" also try
    Code:
    function closeMe(){
    var isConfirmed=confirm('do u want to close window')
    if(isConfirmed){
    window.close()
    }
    }

  • #5
    New Coder
    Join Date
    May 2008
    Posts
    43
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ninnypants View Post
    use "onclick" not "OnClientClick" also try
    Code:
    function closeMe(){
    var isConfirmed=confirm('do u want to close window')
    if(isConfirmed){
    window.close()
    }
    }
    Hi,
    If I use onclick I am getting an error saying that closeMe() is not a member of asp.default.aspx ..I don't know why ..I jus changed the onclientclick() to onclick .and i am getting error

  • #6
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    That's because onclick is JavaScript. If you're using ASP for this you should probably post in the ASP forum


  •  

    Posting Permissions

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