Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1444 I want to open a small dialog box on the screen, ask a yes/no question and have 2-3 buttons: yes, no, and cancel, depending on which is selected, the appropriate page is then displayed in the browser window - is this possible and how might it be done?

irt.org | Knowledge Base | JavaScript | Window | Q1444 [ previous next ]

Q1444 I want to open a small dialog box on the screen, ask a yes/no question and have 2-3 buttons: yes, no, and cancel, depending on which is selected, the appropriate page is then displayed in the browser window - is this possible and how might it be done?

Try:

<script language="JavaScript"><!--
function promptIt() {
   WinId = window.open('questionpage.html','newwin','width=300,height=300,status');
   if (!WinId.opener) WinId.opener = self;
}
//--></script>

and in questionpage.html (that page can also be written dynamically, but will complicate things a little) have:

<center>
<form>
Do you know Aaron?
<br>
<input type="button" value="Yes" onClick="opener.location='yespage.html'; self.close()">
<input type="button" value="No" onClick="opener.location='nopage.html'; self.close()">
<input type="button" value="Cancel" onClick="self.close()">
</center>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.