activate.html HTML Source View


<!!DOCTYPE html>>
<html>
<head>
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>My Wireless Tag List</title>
	<link rel="stylesheet" href="styles/jquery.mobile-1.0b2.min.css" />
	<link rel="stylesheet" href="styles/eth.css" />
	<script src="styles/jquery-1.6.4.min.js" type="text/javascript"></script> 
	<script src="styles/jquery.mobile-1.0b2.min.js" type="text/javascript"></script> 
</head>
<body>
	<div data-role="page" id="activatePage">
		<div data-role="header" data-theme="d" data-position="inline">
			<a href="index.html" data-ajax="false" data-icon="delete" data-iconpos="notext">Cancel</a>
			<h1>
				Activate an Internet Tag Manager</h1>
		</div>
		<div data-role="content" data-theme="c">
			<p>
				Create an account for accessing your Tag Manager</p>
			<form action="" method="post" id="signupform" data-ajax="false" class="ui-body ui-body-c ui-corner-all">
			<div data-role="fieldcontain">
				<label for="mac">
					Tag Manager Serial Number:</label>
				<input type="text" name="mac" id="mac" value=""/>
			</div>
			<fieldset class="ui-corner-all">
				<legend>Create a User Account for this Tag Manager</legend>
				<div data-role="fieldcontain">
					<label for="email">
						Email:</label>
					<input type="email" name="email" id="email" value="" />
				</div>
				<div data-role="fieldcontain">
					<label for="pwd1">
						Choose a Password:</label>
					<input type="password" name="pwd1" id="pwd1" value=""  />
				</div>
				<div data-role="fieldcontain">
					<label for="pwd2">
						Retype the Password:</label>
					<input type="password" name="pwd2" id="pwd2" value="" />
				</div>
			</fieldset>
			<p>
				<input type="checkbox" id="allowmore" class="custom" />
				<label for="allowmore">
					Allow creating more accounts to access this Tag Manager</label>
			</p>
			<button data-inline="1" data-icon="check" type="submit" data-theme="b" id="submitBtn">
				Create</button>
			<a data-role="button" data-ajax="false" data-inline="1" data-icon="delete" data-theme="c" href='index.html'>
				Cancel</a>
			</form>
		</div>
		<div data-role="header" data-position="inline">
			<h1>
				My Wireless Tag List</h1>
			<a href="http://www.caogadgets.com/" data-icon="info" data-iconpos="notext" data-ajax="false"
				class="ui-btn-right">Blog</a>
		</div>
	<script src="styles/client.js" type="text/javascript"></script> 
	<script type="text/javascript">

		$("#activatePage").live("pagebeforecreate", function () {
			var ua = navigator.userAgent.toLowerCase();
			if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {

				$.each([$("#email"), $("#pwd1"), $("#mac"), $("#pwd2")], function (i, o) {
					var lb = o.parent().children("label").eq(0);
					lb.hide(); o.attr("placeholder", lb.text().replace(":", ""));
				});
			}
		});

		$("#mac").blur(function (event) { event.target.value = $(event.target).val().toUpperCase(); });
		$("#mac").blur({ regex: "^\\S{12}$", message: "Serial number is 12 character long.", remote: "ethAccount.asmx/CheckMAC" }, validate);
		$("#email").blur({ regex: "^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$",
			message: "Valid email address required for password recovery."
		}, validate);
		$("#pwd1").blur({ regex: "^\\S{3,}$", message: "password must be at least 3 characters" }, validate);
		$("#pwd2").blur({ match: "#pwd1", message: "passwords must match" }, validate);
		$("#signupform").submit(function (event) {
			event.preventDefault();
			$("#signupform input").trigger('blur');
			if ($("label.error").length == 0) {
				var btn = $("#submitBtn");
				var oldhtml = show_finding(btn, "Creating...");
				var mac = $("#mac").val(); var email = $('#email').val(); var pwd = $('#pwd1').val(); var allowmore = $("#allowmore").is(":checked");
				$.ajax({
					url: WSROOT + "ethAccount.asmx/CreateAccount",
					data: "{MAC:'" + mac + "', email:'" + email + "', password:'" + pwd + "', allowMore:" + allowmore + "}",
					success: function (retval, textStatus) {
						location.href = 'index.html';
					},
					error: function (xhr, textStatus, exception) {
						restore_finding(btn, oldhtml);
						popup_error(xhr, btn);
					}
				});
			}
		});

	</script> 
	</div>
</body>
</html>