Click to See Complete Forum and Search --> : beginner needs help


dazzarino
11-30-2004, 04:13 PM
I need help in writing the following script,

upon startup - text box to appear with an unspecified message with both yes and no buttons. Yes button closes box, No button does nothing.

many thanks

Kor
12-01-2004, 03:39 AM
Originally posted by dazzarino
Yes button closes box, No button does nothing.



Closes box? What do you mean by that. Visibility hidden? Display none? Become readonly? Become disabled?

Warren86
12-01-2004, 08:01 AM
<HTML>
<Head>
<Script Language=JavaScript>

var BtnStr = "<br><br><input type=button value='Yes' onclick='self.close()'>&nbsp<input type=button value='No'></center>"

window.onload=function(){
tmpWin = window.open("","","toolbar=0,scrollbars=0,resizable=0,menubar=0,height=225,width=250")
tmpWin.document.open();
tmpWin.document.write("<center>This is a message");
tmpWin.document.write(BtnStr);
tmpWin.document.close()
}

</Script>
</Head>
<Body>

</Body>
</HTML>