deemurphy Posted February 10, 2009 Share Posted February 10, 2009 Hello, I am using <input type=button value=Close onclick='window.close()' class=button1> but it does not close the window. What have I done wrong with this code. Also how can I have a form do one thing with a continue button and another with an exit button. Thank you LadyDee Link to comment https://forums.phpfreaks.com/topic/144611-2-question/ Share on other sites More sharing options...
webster08 Posted February 10, 2009 Share Posted February 10, 2009 Hello, I am using <input type=button value=Close onclick='window.close()' class=button1> but it does not close the window. What have I done wrong with this code. you can only do this with a pop-up window or window.close() sometimes works when you resize a window (that your wanting to close). i would also use window.close(), like so: "javascript:window.close()"; if i was going to add this function to an inline onclick event (in my button). Also how can I have a form do one thing with a continue button and another with an exit button. create two separate functions (with different actions) and add one function to one button and one function to the other button. Link to comment https://forums.phpfreaks.com/topic/144611-2-question/#findComment-759212 Share on other sites More sharing options...
deemurphy Posted February 10, 2009 Author Share Posted February 10, 2009 I am attaching the page that has the windows.close() because it still is not working. Thank you LadyDee [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/144611-2-question/#findComment-759248 Share on other sites More sharing options...
webster08 Posted February 10, 2009 Share Posted February 10, 2009 if you are just opening the page / visiting the page or you access it through a normal like; most newer browsers will not let your use window.close(). you will have to use it as i described above. Link to comment https://forums.phpfreaks.com/topic/144611-2-question/#findComment-759263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.