A Pen by Captain Anonymous on CodePen.
Created
October 8, 2015 17:48
-
-
Save kavun/6f14ae2bc892209f941e to your computer and use it in GitHub Desktop.
rOwWMe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label class="control-label">Form Action</label> | |
<input type="url" class="form-control" id="theURL" value="https://kevinsw.localtunnel.me/app_services/auth-silent-post.aspx"/> | |
<h2>Silent Post Form</h2> | |
<form action="" method="post" id="theForm"> | |
<div class="col-md-6 form-group"><input type="text" name="x_response_code" value="1"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_response_subcode" value="1"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_response_reason_code" value="1"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_response_reason_text" value="This transaction has been approved."/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_auth_code" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_avs_code" value="P"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_trans_id" value="1821199456"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_invoice_num" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_description" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_amount" value="9.95"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_method" value="CC"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_type" value="auth_capture"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_cust_id" value="1"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_first_name" value="John"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_last_name" value="Smith"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_company" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_address" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_city" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_state" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_zip" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_country" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_phone" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_fax" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_email" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_first_name" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_last_name" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_company" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_address" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_city" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_state" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_zip" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_ship_to_country" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_tax" value="0.0000"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_duty" value="0.0000"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_freight" value="0.0000"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_tax_exempt" value="FALSE"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_po_num" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_MD5_Hash" value="A375D35004547A91EE3B7AFA40B1E727"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_cavv_response" value=""/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_test_request" value="false"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_subscription_id" value="2780205"/></div> | |
<div class="col-md-6 form-group"><input type="text" name="x_subscription_paynum" value="2"/></div> | |
<div class="col-md-6 form-group"><input type="submit" class="btn btn-success form-control" id="theButton" /></div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].forEach.call(document.querySelectorAll('input[type="text"]'), function (e, i) { | |
var newNode = document.createElement('label'); | |
newNode.innerHTML = e.getAttribute('name'); | |
newNode.className="control-label"; | |
e.className="form-control"; | |
e.parentNode.insertBefore(newNode, e); | |
}); | |
document.getElementById('theButton').onclick = function () { | |
document.getElementById('theForm').action = document.getElementById('theURL').value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 1em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment