Skip to content

Instantly share code, notes, and snippets.

@stubotnik
Created April 3, 2012 15:13
Show Gist options
  • Save stubotnik/2292812 to your computer and use it in GitHub Desktop.
Save stubotnik/2292812 to your computer and use it in GitHub Desktop.
Auto-populate sign-up
(function(){
$("firstName").value = "Joe";
$("lastName").value = "Test";
$("email").value = $("emailConfirm").value = "user" + Math.round(Math.random() * 1000000) + "@example.com";
$("birthMonth").selectedIndex = 1;
$("birthDate").selectedIndex = 2;
$("birthYear").selectedIndex = 10;
$("phone").value = "123456789"
$("accName").value = "Tst" + Math.round(Math.random() * 1000000);
$("pwd").value = $("pwdConfirm").value = "Tester1234";
$("securityQuestionID").selectedIndex = 1;
$("securityAnswer").value = "Testing"
$("termsCheck").checked = true;
$("countryID").selectedIndex = 1;
var evt = document.createEvent("HTMLEvents");
evt.initEvent("change", true, true);
$("countryID").dispatchEvent(evt);
var interval = setInterval(function () {
if ($("state").options && $("state").options.length) {
clearInterval(interval);
$("address").value = Math.round(Math.random() * 100000).toString() + " Test Street";
$("city").value = "Big City";
$("state").selectedIndex = 1;
$("postalCode").value = "K1A0B1";
}
}, 300);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment