MyBB Community Forums

Full Version: i am currently working on a dhtml terms of usage page.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need some help implanting a code on my site. It uses javascript. i am wanting to import it to mybb and use cookies so my users only see it once instead of everytime loading a page.

i am also trying to find a way to make it into a custom page using a template through mybb template system.

this is the implantation code:
<script type="text/javascript">

var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")

agreewin.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.getElementById("eula") //Access form with id="eula" inside iframe
	var yesbox=theform.eulabox[0] //Access the first radio button within form
	var nobox=theform.eulabox[1] //Access the second radio button within form
	if (yesbox.checked==true)
		alert("You agreed to the terms")
		
	 if (nobox.checked==true) 
	 alert("You havent agreed"),
		window.location.href = "http://stackoverflow.com";
	return true;
}

</script>
i am wanting to know is how can i get this code to work. i figured out how to show up a template in it but it just loads up to the left and not where i need it to be.

also i am wanting to know how i can add cookie settings to it.
what it looks like on the site:
[Image: bad_idea.png]

what it is suppose to look like:
[Image: supposetobe.png]
This is actually quite interesting:
http://www.htmlgoodies.com/beyond/javasc...osting.htm
(2013-08-15, 03:50 AM)7uyk Wrote: [ -> ]This is actually quite interesting:
http://www.htmlgoodies.com/beyond/javasc...osting.htm

And if they disable javascript?
it does that already. i just need to figure out how to get it center instead of showing in the top left corner.

its suppose to show up like it does in the 2nd photo instead of showing by the top left corner of the site. it would be a nice way of making sure that anyone that shows up on the site understands what is expected of them.