Creating a pop-up EULA - Stuck
I am currently using the following code. 
<html>
<body>
<p>Testing!</p>
</body>
<script type="text/javascript" language="javascript">

var agreement = GetCookie();

// checks for cookie and displays disclaimer alert if new user

if (agreement == "") {

var decision = confirm("Test");

if (decision == true) {

// writes a cookie

var oneMinute = 60 * 1000

var oneHour = oneMinute * 60

var oneDay = oneHour * 24

var today = new Date()

var nextXmas = new Date()

nextXmas.setMonth(11)

nextXmas.setDate(31)

var expiredays = nextXmas.getTime() - today.getTime()

expiredays = Math.floor(expiredays/oneDay)

var exdate = new Date()

exdate.setDate(exdate.getDate() + 1)

document.cookie = "PartnerAgreement" + "=" + escape("Agree To Disclaimer") +

((expiredays == null) ? "" : ";path=/; expires=" + exdate.toGMTString())

}

else {

// redirect

window.location = "/_layouts/signout.aspx";

// or close the browser window

//window.opener='x';

//window.close();

}

}

// gets the Cookie if it exists

function GetCookie() {

if (document.cookie.length > 0) {

c_name = "PartnerAgreement";

c_start = document.cookie.indexOf(c_name + "=")

if (c_start != -1) {

c_start = c_start + c_name.length + 1

c_end = document.cookie.indexOf(";", c_start)

if (c_end == -1) c_end = document.cookie.length

return agreement = unescape(document.cookie.substring(c_start, c_end))

}

}

return "";

}
 document.write(exdate);
</script>
</html>
but the problem I have is that I cannot format the text correctly, so I need help formatting the text or ideally loading a PDF in place of the text.
July 8th, 2015 2:51pm

No idea what you mean by formatting.  In HTML we use CSS to format the HTML.

For web page help you will need to post in web developers forum.

Free Windows Admin Tool Kit Click here and download it now
July 8th, 2015 3:51pm

Here is what you code look s like.  It makes little sense along with your request.  You will have to ask a more specific question no matter where you post.

<html>
<body>
<p>Testing!</p>
</body>
<script type="text/javascript" language="javascript">

	var agreement = GetCookie();

	// checks for cookie and displays disclaimer alert if new user
	if (agreement == "") {
		var decision = confirm("Test");
		if (decision == true) {
			// writes a cookie
			var oneMinute = 60 * 1000
			var oneHour = oneMinute * 60
			var oneDay = oneHour * 24
			var today = new Date()
			var nextXmas = new Date()
			nextXmas.setMonth(11)
			nextXmas.setDate(31)
			var expiredays = nextXmas.getTime() - today.getTime()
			expiredays = Math.floor(expiredays/oneDay)
			var exdate = new Date()
			exdate.setDate(exdate.getDate() + 1)
			document.cookie = "PartnerAgreement" + "=" + escape("Agree To Disclaimer") + ((expiredays == null) ? "" : ";path=/; expires=" + exdate.toGMTString())
		}else{
			// redirect
			window.location = "/_layouts/signout.aspx";
			// or close the browser window
			//window.opener='x';
			//window.close();
		
		}
	}

	// gets the Cookie if it exists
	function GetCookie() {
		if (document.cookie.length > 0) {
			c_name = "PartnerAgreement";
			c_start = document.cookie.indexOf(c_name + "=")
			if (c_start != -1) {
				c_start = c_start + c_name.length + 1
				c_end = document.cookie.indexOf(";", c_start)
				if (c_end == -1) c_end = document.cookie.length
				return agreement = unescape(document.cookie.substring(c_start, c_end))
			}
		}
		return "";
	}
	document.write(exdate);
	
</script>
July 8th, 2015 3:58pm

Well see variable "Confirm" is actually a dialog that appears, so if you run that as html you should get a pop-up that says "Test" and then you can select ok/cancel. What I would like to do is in place of the "Test" text I would like to display or use a word document or PDF document.

Mainly because the confirm dialog isn't big enough.
  • Edited by Chuck_1987 10 hours 53 minutes ago A word.
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2015 4:20pm

You can't from an HTML page.  You can from an HTA but it must reside locally.

If this is from a web server then post in http://forums.iis.net to learn how to do it.

July 8th, 2015 4:44pm

Well see variable "Confirm" is actually a dialog that appears, so if you run that as html you should get a pop-up that says "Test" and then you can select ok/cancel. What I would like to do is in place of the "Test" text I would like to display or use a word document or PDF document.

Mainly because the confirm dialog isn't big enough.
  • Edited by Chuck_1987 Wednesday, July 08, 2015 8:15 PM A word.
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2015 8:14pm

Yeah, I need something in HTML/JavaScript. Ideally the user would go to a site, like google.com, and they would get a pop-up that would show them an EULA which they could either agree or cancel and if they agree they go to google.com if they do not agree they get redirected to another page. And it would store a cookie for a day prior to expiring and required another eula acceptance.

My issue is that I have it working in Jscript BUT i cannot change the width of the jscript confirm window.

 
July 9th, 2015 12:14am

This is not a web development forum.  You need to post in the forum I linked above or another web forum.  All of what you want can be easily done from a web page-.  You just need to post in the correct forum.
Free Windows Admin Tool Kit Click here and download it now
July 9th, 2015 12:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics