Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!-- converted from php http://www.geekpedia.com/tutorial213_Creating-a-UPS-Shipping-Calculator.html -->
- <html>
- <head>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
- <meta charset=utf-8 />
- <title>Unofficial UPS Shipping Calculator</title>
- </head>
- <body>
- <form id="shipping">
- Address Type:
- <select name="selResidential">
- <option value="01">Residential</option>
- <option value="02">Commercial</option>
- </select><br />
- Packaging:
- <select name="selPackaging">
- <option value="00">Customer Packaging</option>
- <option value="01">UPS Letter Envelope</option>
- <option value="03">UPS Tube</option>
- <option value="21">UPS Express Box</option>
- <option value="24">UPS Worldwide 25KG Box</option>
- <option value="25">UPS Worldwide 10KG Box</option>
- </select><br />
- Service Type:
- <select name="selService">
- <option value="1DM">Next Day Air Early AM</option>
- <option value="1DA">Next Day Air</option>
- <option value="1DP">Next Day Air Saver</option>
- <option value="2DM">2nd Day Air AM</option>
- <option value="2DA">2nd Day Air</option>
- <option value="3DS">3 Day Select</option>
- <option value="GND">Ground</option>
- <option value="STD">Canada Standard</option>
- <option value="XPR">Worldwide Express</option>
- <option value="XDM">Worldwide Express Plus</option>
- <option value="XPD">Worldwide Expedited</option>
- <option value="WXS">Worldwide Saver</option>
- </select><br />
- Rate:
- <select name="selRate">
- <option value="Regular+Daily+Pickup">Daily Pickup service</option>
- <option value="OP_WEB">Oncall Air Pickup Web (arrange on the web for UPS to pick up my packages)</option>
- <option value="OP_PHONE">Oncall Air Pickup Phone (arrange by phone for UPS to pick up my packages)</option>
- <option value="One+Time+Pickup">One Time Pickup</option>
- <option value="Letter+Center">Drop-box Letter Center</option>
- <option value="Customer+Counter">Customer Counter</option>
- </select><br />
- Package Weight: <input type="text" name="txtPackWeight" value="1" /> pounds<br />
- Package Length: <input type="text" name="txtPackLength" value="5" /> inches<br />
- Package Width: <input type="text" name="txtPackWidth" value="5" /> inches<br />
- Package Height: <input type="text" name="txtPackHeight" value="5" /> inches<br />
- From Zip: <input type="text" name="txtFromZip" value="98052" /><br />
- From City: <input type="text" name="txtFromCity" value="Redmond" /><br />
- From Country: <input type="text" name="txtFromCountry" value="US" /><br />
- To Zip: <input type="text" name="txtToZip" value="94043" /><br />
- To City: <input type="text" name="txtToCity" value="Mountain View" /><br />
- To Country: <input type="text" name="txtToCountry" value="US" /><br />
- <input type="submit" value="Submit" />
- </form>
- <script type="text/javascript">
- $('#shipping').submit(function(e){
- var url = [
- "http://www.ups.com/using/services/rave/qcostcgi.cgi?accept_UPS_license_agreement=yes",
- "10_action=3",
- "13_product="+ $('* [name="selService"]').val(),
- "14_origCountry="+ $('* [name="txtFromCountry"]').val(),
- "15_origPostal="+ $('* [name="txtFromZip"]').val(),
- "origCity="+ $('* [name="txtFromCity"]').val(),
- "19_destPostal="+ $('* [name="txtToZip"]').val(),
- "20_destCity="+ $('* [name="txtToCity"]').val(),
- "22_destCountry="+ $('* [name="txtToCountry"]').val(),
- "23_weight="+ $('* [name="txtPackWeight"]').val(),
- "47_rateChart="+ $('* [name="selRate"]').val(),
- "48_container="+ $('* [name="selPackaging"]').val(),
- "49_residential="+ $('* [name="selResidential"]').val(),
- "25_length="+ $('* [name="txtPackLength"]').val(),
- "26_width="+ $('* [name="txtPackWidth"]').val(),
- "27_height="+ $('* [name="txtPackHeight"]').val()
- ].join('&');
- window.open(url); //you want to split output by '%' for it to make sense
- e.preventDefault();
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement