View Full Version : Eula (end user agreement prompt script)

11-04-2002, 03:02 AM
Add to head:

<script language="javascript1.2" type="text/javascript">

submit_accept = false;
function chk_sub(bg,cl,tbg,tcl,txtbg,txtcl,frm) {
document.getElementById("eula").style.backgroundColor = bg;
document.getElementById("eula").style.color = cl;
document.getElementById("button1").style.backgroundColor = bg;
document.getElementById("button1").style.color = cl;
document.getElementById("button2").style.backgroundColor = bg;
document.getElementById("button2").style.color = cl;
document.getElementById("ttlbar").style.backgroundColor = tbg;
document.getElementById("ttlbar").style.color = tcl;
document.getElementById("txtarea2").style.backgroundColor = txtbg;
document.getElementById("txtarea2").style.color = txtcl;
l = ((parseInt(document.body.clientWidth)-380)/2);
t = ((parseInt(document.body.clientHeight)-424)/2);
if (l<0) { l=0 };
if (t<0) { t=0 };
document.getElementById("eula").style.display = "";
document.getElementById("eula").style.left = l;
document.getElementById("eula").style.top = t;
frm2 = frm;
function loader() {
tblhtml = '<table border="0" cellspacing="2" cellpadding="0" style="position: absolute; z-Index: 100; background-color: menu; width: 380px; height: 424px; border: 2px white outset; font-family: Tahoma; font-size: 11px; text-align: justify; display: none;" id="eula">'+
'<td style="width: 480; height: 20px; color: white; font-size: 12px; background-color: highlight; font-family: Arial; font-weight: bold;" id="ttlbar">&nbsp;HTML Help Workshop 1.3</td>'+
'<td style="height: 20px; padding-left: 10px; padding-right: 10px;"><br>Please read the following agreement.<br><br></td>'+
'<td style="text-align: center;">'+
'<textarea style="width: 360px; height: 250px; font-family: Tahoma; font-size: 11px;" id="txtarea2" readonly></textarea></td>'+
'<td style="height: 20px; padding-left: 10px; padding-right: 10px;"><br>Do you accept all of the terms of the preceding License Agreement? If you Choose No, you will not be able to continue. To continue you must accept this agreement.<br><br></td>'+
'<td style="height: 20px; text-align: right; padding-right: 10px; padding-bottom: 10px;">'+
'<input type="button" value="Yes" style="width: 75px; height: 22px;" onclick="submit_accept = true; frm2.submit();" id="button1">&nbsp;&nbsp;'+
'<input type="button" value="No" style="width: 75px; height: 22px;" onclick="document.getElementById(\'eula\').style.display=\'none\';" id="button2">'+
tmp = document.getElementById('txtarea1').innerHTML;
document.getElementById('txtarea1').innerHTML = tblhtml;
document.getElementById('txtarea1').style.display = "";
document.getElementById('txtarea2').innerHTML = tmp;

window.onload = loader;


add to form:

onSubmit="chk_sub('menu','black','highlight','white','white','black',this); if (!submit_accept) { return false; };"

add to body:

<div id="txtarea1" style="display: none;">
This is my EULA!

Give it a try. http://pages.infinit.net/mvideos/agree.htm (http://pages.infinit.net/mvideos/agree.htm)

Tested in IE6

11-07-2002, 04:25 AM
pretty sweet looking, only thing is you may want to add another layer behind it so that nothing on the page can be selected..

11-12-2002, 05:52 AM
Drop down form menu's show through the EULA "window" for me.

i'm using IE 6.0

[edit] Also.... after toying with it a bit I was wondering how to allow html in the main text box. All I really need accomplished is to be able to use <br> tags or another method of breaking lines.

11-14-2002, 06:00 PM
Thanx for the input. Soryy but I don't know how to fix that.

but I did ask:

If that doesn't pull through I can always redo it with a popup.

11-14-2002, 07:24 PM
instead of using <Br> use \n thats what think it is, it might be n\ though.


11-14-2002, 07:29 PM
Works with HTML:


11-15-2002, 02:00 AM
I realize it's cool... but for me on IE 5.5 it pops up with only the bottom half displayed on my monitor, and it isn't "draggable".

Wouldn't something like this (a EULA) be better displayed on a webpage form unless you're actually using it with a software installation?


11-15-2002, 02:49 AM
*bows to goose*

Here's the page i'm using this script at BTW:

Havent implimented the new html allowable version yet though, may have by the time you see this :cool: .

[edit] and no... I did'nt make that pages layout to mimic the EULA one, my website already has a layout setup with windows like that and the EULA fits well :)

11-15-2002, 05:38 PM
Slowly getting better.


This time done using a popup, but haven't set up custom colors yet. I also had a bit of trouble getting it to stay on top, but I think its my pc. Its acting really weird with onblur and onfocus. I also plan on making the IE version draggable, but not today.

11-15-2002, 06:02 PM

11-15-2002, 08:13 PM
eeep. that link opens the EULA in full-screen mode on a white background, and is'nt draggable for me.

Usin IE 6

11-15-2002, 08:24 PM
Works fine for me in ie6 and moz1.2b.

Have you tried any other chromeless wiindow scripts?


11-15-2002, 08:26 PM
Those open full screen for me as well :/... I've been to that page at dynamic drive before and I don't remember them going full screen on me.

11-16-2002, 01:26 AM
Works good for me now- I kind of like it. :D

11-16-2002, 01:47 AM
Well a half approval isn't too bad.

I know it still needs work.

11-16-2002, 01:53 AM
Well my "half approval" was just based on my original opinion, which is I don't see a reason to popup a window to get you to agree to something, unless it's some kind of software application itself. I would just use normal form validation. :D

I do appreciate the idea, though, and I like your graphical emulation - and on IE it looks very very convincing!

I haven't tested it in any other browsers (yet), but the graphics are perfect from what I have seen. I just think something like this is a waste of time, except maybe for your own (and our) education, since the normal internet user wouldn't get a kick out of it like we do, or even realize some cool coding was going on. :)

Very cool results so far though, and a very quick fix for the bug I posted! Like I said, I haven't tested it in other browsers yet, but it doesn't open fullscreen in IE 5.50. ;)

11-16-2002, 02:02 AM
I see what you're saying and take no offense and like you said, it's more for educational purposes (plus what better do I have to do). Thanx for the input.

Odd. Works in IE5.0