Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var z = false;
- function onLoad(el, callback){
- var timer = setInterval(function(){
- if(el.length !== 0){
- callback();
- clearInterval(timer);
- }
- }, 1)
- }
- function ss(el,i){
- el.find("option[value='" + i + "']").attr("selected", "selected");
- }
- function step1(){
- var i = {
- "your name": "Sunil Chadha",
- "email": "sunilchadha@yahoo.com",
- "telephone (required for entry)": "(917) 604-1950",
- "s": "Brooklyn"
- };
- $('label').each(function(){
- var g = $(this); var v = g.text(); var h = i[v];
- if(h){g.parent().find("input").val(h);}
- if(v == i["s"]){g.click(); z = true;}
- });
- $("#step_1_button").click();
- }
- function step2(){
- var i = {
- "billing address": "954 78th Street",
- "billing address 2": "",
- "zip": "11228",
- "city": "Brooklyn",
- "credit card number": "4262 9051 0836 2174",
- "cvv": "348",
- "s1": "NY",
- "s2": "12", // Exp MONTH
- "s3": "2023" // Exp Year (4 letters)
- };
- $('label').each(function(){
- var g = $(this); var v = g.text(); var h = i[v]; var k = g.parent().find("select");
- if(h){g.parent().find("input").val(h);}
- if(v=="state"){ss(k,i["s1"]);}
- if(v=="exp. month"){ss(k,i["s2"]);}
- if(v=="exp. year"){ss(k,i["s3"]);}
- });
- $('input').each(function(){
- var o = $(this);
- if(o.is(":visible") && o.val().length == 0){o.css("border", "4px solid yellow");}
- });
- $('select').each(function(){
- var o = $(this);
- if(o.val().length == 0){o.css("border", "4px solid yellow");}
- });
- if(!z){ $('.magic-radio').eq(0).parent().css('border', '3px solid yellow'); }
- }
- onLoad($("#step_1_button"), step1);
- onLoad($("#submit_button"), function(){$("#step_2").show(); step2();});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement