Mercurial > laserkard
diff paypal/classic.html @ 0:599d0315537d laserkard
[svn r1] initial import
author | rlm |
---|---|
date | Wed, 30 Dec 2009 02:01:25 -0500 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/paypal/classic.html Wed Dec 30 02:01:25 2009 -0500 1.3 @@ -0,0 +1,354 @@ 1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 1.5 +<html> 1.6 + 1.7 +<head> 1.8 +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 1.9 +<title></title> 1.10 + 1.11 + 1.12 +<!-- Start of Script --> 1.13 +<script type="text/javascript"> 1.14 +<!-- 1.15 +// 1.16 +function Dollar (val) { // force to valid dollar amount 1.17 +var str,pos,rnd=0; 1.18 + if (val < .995) rnd = 1; // for old Netscape browsers 1.19 + str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape 1.20 + pos = str.indexOf ("."); 1.21 + if (pos > 0) str = str.substring (rnd, pos + 3); 1.22 + return str; 1.23 +} 1.24 + 1.25 +var amt,des,obj,val,op1a,op1b,op2a,op2b,op3a,op3b,op4a,op4b,op5a,op5b,op6a,op6b,op7a,op7b,op8a,op8b,op9a,op9b,itmn; 1.26 + 1.27 +function ChkTok (obj1) { 1.28 +var j,tok,ary=new Array (); // where we parse 1.29 + ary = val.split (" "); // break apart 1.30 + for (j=0; j<ary.length; j++) { // look at all items 1.31 +// first we do single character tokens... 1.32 + if (ary[j].length < 2) continue; 1.33 + tok = ary[j].substring (0,1); // first character 1.34 + val = ary[j].substring (1); // get data 1.35 + if (tok == "@") amt = val * 1.0; 1.36 + if (tok == "+") amt = amt + val*1.0; 1.37 + if (tok == "%") amt = amt + (amt * val/100.0); 1.38 + if (tok == "-") amt = amt - val*1.0; 1.39 + if (tok == "#") { // record item number 1.40 + if (obj1.item_number) obj1.item_number.value = val; 1.41 + ary[j] = ""; // zap this array element 1.42 + } 1.43 +// Now we do 3-character tokens... 1.44 + if (ary[j].length < 4) continue; 1.45 + tok = ary[j].substring (0,3); // first 3 chars 1.46 + val = ary[j].substring (3); // get data 1.47 + if (tok == "s1=") { // value for shipping 1.48 + if (obj1.shipping) obj1.shipping.value = val; 1.49 + ary[j] = ""; // clear it out 1.50 + } 1.51 + if (tok == "s2=") { // value for shipping2 1.52 + if (obj1.shipping2) obj1.shipping2.value = val; 1.53 + ary[j] = ""; // clear it out 1.54 + } 1.55 + } 1.56 + val = ary.join (" "); // rebuild val with what's left 1.57 +} 1.58 + 1.59 +function StorVal () { 1.60 +var tag; 1.61 + tag = obj.name.substring (obj.name.length-2); // get flag 1.62 + if (tag == "1a") op1a = op1a + " " + val; 1.63 + else if (tag == "1b") op1b = op1b + " " + val; 1.64 + else if (tag == "2a") op2a = op2a + " " + val; 1.65 + else if (tag == "2b") op2b = op2b + " " + val; 1.66 + else if (tag == "3a") op3a = op3a + " " + val; 1.67 + else if (tag == "3b") op3b = op3b + " " + val; 1.68 + else if (tag == "4a") op4a = op4a + " " + val; 1.69 + else if (tag == "4b") op4b = op4b + " " + val; 1.70 + else if (tag == "5a") op5a = op5a + " " + val; 1.71 + else if (tag == "5b") op5b = op5b + " " + val; 1.72 + else if (tag == "6a") op6a = op6a + " " + val; 1.73 + else if (tag == "6b") op6b = op6b + " " + val; 1.74 + else if (tag == "7a") op7a = op7a + " " + val; 1.75 + else if (tag == "7b") op7b = op7b + " " + val; 1.76 + else if (tag == "8a") op8a = op8a + " " + val; 1.77 + else if (tag == "8b") op8b = op8b + " " + val; 1.78 + else if (tag == "9a") op9a = op9a + " " + val; 1.79 + else if (tag == "9b") op9b = op9b + " " + val; 1.80 + else if (tag == "3i") itmn = itmn + " " + val; 1.81 + else if (des.length == 0) des = val; 1.82 + else des = des + ", " + val; 1.83 +} 1.84 + 1.85 +function ReadForm (obj1, tst) { // Read the user form 1.86 +var i,j,pos; 1.87 + amt=0;des="";op1a="";op1b="";op2a="";op2b="";op3a="";op3b="";op4a="";op4b="";op5a="";op5b="";op6a="";op6b="";op7a="";op7b="";op8a="";op8b="";op9a="";op9b="";itmn=""; 1.88 + if (obj1.baseamt) amt = obj1.baseamt.value*1.0; // base amount 1.89 + if (obj1.basedes) des = obj1.basedes.value; // base description 1.90 + if (obj1.baseon0) op1a = obj1.baseon0.value; // base options 1.91 + if (obj1.baseos0) op1b = obj1.baseos0.value; 1.92 + if (obj1.baseon1) op2a = obj1.baseon1.value; 1.93 + if (obj1.baseos1) op2b = obj1.baseos1.value; 1.94 + if (obj1.baseon2) op3a = obj1.baseon2.value; 1.95 + if (obj1.baseos2) op3b = obj1.baseos2.value; 1.96 + if (obj1.baseon3) op4a = obj1.baseon3.value; 1.97 + if (obj1.baseos3) op4b = obj1.baseos3.value; 1.98 + if (obj1.baseon4) op5a = obj1.baseon4.value; 1.99 + if (obj1.baseos4) op5b = obj1.baseos4.value; 1.100 + if (obj1.baseon5) op6a = obj1.baseon5.value; 1.101 + if (obj1.baseos5) op6b = obj1.baseos5.value; 1.102 + if (obj1.baseon6) op7a = obj1.baseon6.value; 1.103 + if (obj1.baseos6) op7b = obj1.baseos6.value; 1.104 + if (obj1.baseon7) op8a = obj1.baseon7.value; 1.105 + if (obj1.baseos7) op8b = obj1.baseos7.value; 1.106 + if (obj1.baseon8) op9a = obj1.baseon8.value; 1.107 + if (obj1.baseos8) op9b = obj1.baseos8.value; 1.108 + if (obj1.baseitn) itmn = obj1.baseitn.value; 1.109 + for (i=0; i<obj1.length; i++) { // run entire form 1.110 + obj = obj1.elements[i]; // a form element 1.111 + if (obj.type == "select-one") { // just selects 1.112 + if (obj.name == "quantity" || 1.113 + obj.name == "amount") continue; 1.114 + pos = obj.selectedIndex; // which option selected 1.115 + val = obj.options[pos].value; // selected value 1.116 + ChkTok (obj1); // check for any specials 1.117 + 1.118 + if (obj.name == "on0" || // let this go where it wants 1.119 + obj.name == "os0" || 1.120 + obj.name == "on1" || 1.121 + obj.name == "os1" || 1.122 + obj.name == "on2" || 1.123 + obj.name == "os2" || 1.124 + obj.name == "on3" || 1.125 + obj.name == "os3" || 1.126 + obj.name == "on4" || 1.127 + obj.name == "os4" || 1.128 + obj.name == "on5" || 1.129 + obj.name == "os5" || 1.130 + obj.name == "on6" || 1.131 + obj.name == "os6" || 1.132 + obj.name == "on7" || 1.133 + obj.name == "os7" || 1.134 + obj.name == "on8" || 1.135 + obj.name == "os8" || 1.136 + obj.name == "on9" || 1.137 + obj.name == "os9") continue; 1.138 + 1.139 + StorVal (); 1.140 + 1.141 + } else 1.142 + if (obj.type == "checkbox" || // just get checkboxex 1.143 + obj.type == "radio") { // and radios 1.144 + if (obj.checked) { 1.145 + val = obj.value; // the value of the selection 1.146 + ChkTok (obj1); 1.147 + StorVal (); 1.148 + } 1.149 + } else 1.150 + if (obj.type == "select-multiple") { //one or more 1.151 + for (j=0; j<obj.options.length; j++) { // run all options 1.152 + if (obj.options[j].selected) { 1.153 + val = obj.options[j].value; // selected value (default) 1.154 + ChkTok (obj1); 1.155 + StorVal (); 1.156 + } 1.157 + } 1.158 + } else 1.159 + if ((obj.type == "text" || // just read text, 1.160 + obj.type == "textarea") && 1.161 + obj.name != "tot" && // but not from here 1.162 + obj.name != "quantity") { 1.163 + val = obj.value; // get the data 1.164 + if (val == "" && tst) { // force an entry 1.165 + alert ("Enter data for " + obj.id); 1.166 + return false; 1.167 + } 1.168 + StorVal (); 1.169 + } 1.170 + } 1.171 +// Now summarize stuff we just processed, above 1.172 + if (op1a.length > 0) obj1.on0.value = op1a; 1.173 + if (op1b.length > 0) obj1.os0.value = op1b; 1.174 + if (op2a.length > 0) obj1.on1.value = op2a; 1.175 + if (op2b.length > 0) obj1.os1.value = op2b; 1.176 + if (op3a.length > 0) obj1.on2.value = op3a; 1.177 + if (op3b.length > 0) obj1.os2.value = op3b; 1.178 + if (op4a.length > 0) obj1.on3.value = op4a; 1.179 + if (op4b.length > 0) obj1.os3.value = op4b; 1.180 + if (op5a.length > 0) obj1.on4.value = op5a; 1.181 + if (op5b.length > 0) obj1.os4.value = op5b; 1.182 + if (op6a.length > 0) obj1.on5.value = op6a; 1.183 + if (op6b.length > 0) obj1.os5.value = op6b; 1.184 + if (op7a.length > 0) obj1.on6.value = op7a; 1.185 + if (op7b.length > 0) obj1.os6.value = op7b; 1.186 + if (op8a.length > 0) obj1.on7.value = op8a; 1.187 + if (op8b.length > 0) obj1.os7.value = op8b; 1.188 + if (op9a.length > 0) obj1.on8.value = op9a; 1.189 + if (op9b.length > 0) obj1.os8.value = op9b; 1.190 + if (itmn.length > 0) obj1.item_number.value = itmn; 1.191 + obj1.item_name.value = des; 1.192 + obj1.amount.value = Dollar (amt); 1.193 + if (obj1.tot) obj1.tot.value = "$" + Dollar (amt); 1.194 +} 1.195 +//--> 1.196 +</script> 1.197 +<!-- End of Script --> 1.198 +</head> 1.199 + 1.200 + 1.201 + 1.202 +<body> 1.203 + 1.204 +Widget Flower Bouquet 1.205 +<!-- Start of Form --> 1.206 +<!-- Note: target="paypal" was replaced with the variable target="_self" --> 1.207 +<!-- Note: shopping_url also added to code --> 1.208 +<!-- These two changes allow better functionality with IE and Firefox --> 1.209 +<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target = '_self'; return ReadForm(this, true);"> 1.210 +<input type="hidden" name="add" value="1"> 1.211 +<input type="hidden" name="cmd" value="_cart"> 1.212 +<!--your email address goes here --> 1.213 +<input type="hidden" name="business" value="youremail@youremail.com"> 1.214 +<input type="hidden" name="item_name"> 1.215 +<input type="hidden" name="item_number" "WFB-1001"> 1.216 +<input type="hidden" name="amount"> 1.217 +<input type="hidden" name="currency_code" value="USD"> 1.218 +<input type="hidden" name="lc" value="US"> 1.219 +<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/your_page.html"> 1.220 +<input type="hidden" name="cancel_return" value="http://www.yourwebsite.com/Cancel.html"> 1.221 +<input type="hidden" name="return" value="http://www.yourwebsite.com"> 1.222 +<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted"> 1.223 + 1.224 + 1.225 +<!-- --> 1.226 +<input type="hidden" name="baseamt" value="00"> 1.227 +<input type="hidden" name="basedes" value="Widget Flower Bouquet"> 1.228 +<!-- --> 1.229 +<input type="hidden" name="baseon0" value="Requested Delivery Date"> 1.230 +<input type="hidden" name="baseos0"> 1.231 +<input type="hidden" name="baseon1" value="Deliver To"> 1.232 +<input type="hidden" name="baseos1"> 1.233 +<input type="hidden" name="baseon2" value="Phone"> 1.234 +<input type="hidden" name="baseos2"> 1.235 +<input type="hidden" name="baseon3" value="Address"> 1.236 +<input type="hidden" name="baseos3"> 1.237 +<input type="hidden" name="baseon4" value="Town/City"> 1.238 +<input type="hidden" name="baseos4"> 1.239 +<input type="hidden" name="baseon5" value="From"> 1.240 +<input type="hidden" name="baseos5"> 1.241 +<input type="hidden" name="baseon6" value="Sender Email"> 1.242 +<input type="hidden" name="baseos6"> 1.243 +<input type="hidden" name="baseon7" value="Sender Phone"> 1.244 +<input type="hidden" name="baseos7"> 1.245 +<input type="hidden" name="baseon8" value="Message"> 1.246 +<input type="hidden" name="baseos8"> 1.247 +<input type="hidden" name="baseitn"> 1.248 +<!-- --> 1.249 +<input type="hidden" name="on0"> 1.250 +<input type="hidden" name="os0"> 1.251 +<input type="hidden" name="on1"> 1.252 +<input type="hidden" name="os1"> 1.253 +<input type="hidden" name="on2"> 1.254 +<input type="hidden" name="os2"> 1.255 +<input type="hidden" name="on3"> 1.256 +<input type="hidden" name="os3"> 1.257 +<input type="hidden" name="on4"> 1.258 +<input type="hidden" name="os4"> 1.259 +<input type="hidden" name="on5"> 1.260 +<input type="hidden" name="os5"> 1.261 +<input type="hidden" name="on6"> 1.262 +<input type="hidden" name="os6"> 1.263 +<input type="hidden" name="on7"> 1.264 +<input type="hidden" name="os7"> 1.265 +<input type="hidden" name="on8"> 1.266 +<input type="hidden" name="os8"> 1.267 +<input type="hidden" name="on9"> 1.268 +<input type="hidden" name="os9"> 1.269 +<!-- --> 1.270 + 1.271 +<!-- --> 1.272 +Select Size: 1.273 +<select name="Size" onchange="ReadForm (this.form, false);"> 1.274 + <option value="Please Choose" selected>Please Choose</option> 1.275 + <option value="Small @25.00">Small - $25.00</option> 1.276 + <option value="Medium @30.00">Medium - $30.00</option> 1.277 + <option value="Large @35.00">Large - $35.00</option> 1.278 + </select> 1.279 +<!-- --> 1.280 +<br><br> 1.281 + 1.282 +<!-- Start of Options --> 1.283 +Extras: 1.284 +<br><br> 1.285 +<input type = "checkbox" 1.286 + onclick = "ReadForm (this.form, false);" 1.287 + value = "Wrapper Package +5.00"> 1.288 +Hand Tied Ribbon and Bow Wrapper Package - $5.00 1.289 + 1.290 +<br><br> 1.291 +<input type = "checkbox" 1.292 + onclick = "ReadForm (this.form, false);" 1.293 + value = "Chocolates Bites +9.00"> 1.294 +1 Lb Box Homemade Dark Chocolates Bites - $9.00 1.295 + 1.296 +<!-- End of Options --> 1.297 + 1.298 +<!-- Start of Text Input Fields --> 1.299 +<br><br> 1.300 +Requested Delivery Date: 1.301 +<input type="text" id="Requested Delivery Date" name="deliverydate_1b" size="10"> 1.302 +<!-- --> 1.303 +<br><br> 1.304 +Deliver To: 1.305 +<input type="text" id="Deliver To" name="deliverto_2b" size="20"> 1.306 +<!-- --> 1.307 +<br><br> 1.308 +Phone: 1.309 +<input type="text" id="Phone" name="phone_3b" size="12"> 1.310 +<!-- --> 1.311 +<br><br> 1.312 +Address: 1.313 +<input type="text" id="Address" name="address_4b" size="20"> 1.314 +<!-- --> 1.315 +<br><br> 1.316 +Town/City: 1.317 +<input type="text" id="Town/City" name="towncity_5b" size="20"> 1.318 +<!-- --> 1.319 +<br><br> 1.320 +From: 1.321 +<input type="text" id="From" name="from_6b" size="20"> 1.322 +<!-- --> 1.323 +<br><br> 1.324 +Your Email: 1.325 +<input type="text" id="Your Email" name="semail_7b" size="20"> 1.326 +<!-- --> 1.327 +<br><br> 1.328 +Your Phone: 1.329 +<input type="text" id="Your Phone" name="sphone_8b" size="12"> 1.330 +<!-- --> 1.331 +<br><br> 1.332 +Message: 1.333 +<input type="text" id="Message" name="message_9b" size="30"> 1.334 +<!-- End of Text Input Fields --> 1.335 + 1.336 + 1.337 +<br><br><br> 1.338 + 1.339 +Total Cost: 1.340 +<input class="nbor" type="text" name="tot" size="8" value="$0.00"> 1.341 + 1.342 +<br><br> 1.343 + 1.344 +<input type = "button" 1.345 + value = "Reset FORM" 1.346 + onclick = "this.form.reset();"> 1.347 + 1.348 +<br><br> 1.349 + 1.350 + 1.351 + 1.352 +<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" name="submit" alt="cart add"> 1.353 +</form> 1.354 +<!-- End of Form --> 1.355 + 1.356 +</body> 1.357 +</html>