annotate paypal/classic.html @ 0:599d0315537d laserkard

[svn r1] initial import
author rlm
date Wed, 30 Dec 2009 02:01:25 -0500
parents
children
rev   line source
rlm@0 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
rlm@0 2 <html>
rlm@0 3
rlm@0 4 <head>
rlm@0 5 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
rlm@0 6 <title></title>
rlm@0 7
rlm@0 8
rlm@0 9 <!-- Start of Script -->
rlm@0 10 <script type="text/javascript">
rlm@0 11 <!--
rlm@0 12 //
rlm@0 13 function Dollar (val) { // force to valid dollar amount
rlm@0 14 var str,pos,rnd=0;
rlm@0 15 if (val < .995) rnd = 1; // for old Netscape browsers
rlm@0 16 str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape
rlm@0 17 pos = str.indexOf (".");
rlm@0 18 if (pos > 0) str = str.substring (rnd, pos + 3);
rlm@0 19 return str;
rlm@0 20 }
rlm@0 21
rlm@0 22 var amt,des,obj,val,op1a,op1b,op2a,op2b,op3a,op3b,op4a,op4b,op5a,op5b,op6a,op6b,op7a,op7b,op8a,op8b,op9a,op9b,itmn;
rlm@0 23
rlm@0 24 function ChkTok (obj1) {
rlm@0 25 var j,tok,ary=new Array (); // where we parse
rlm@0 26 ary = val.split (" "); // break apart
rlm@0 27 for (j=0; j<ary.length; j++) { // look at all items
rlm@0 28 // first we do single character tokens...
rlm@0 29 if (ary[j].length < 2) continue;
rlm@0 30 tok = ary[j].substring (0,1); // first character
rlm@0 31 val = ary[j].substring (1); // get data
rlm@0 32 if (tok == "@") amt = val * 1.0;
rlm@0 33 if (tok == "+") amt = amt + val*1.0;
rlm@0 34 if (tok == "%") amt = amt + (amt * val/100.0);
rlm@0 35 if (tok == "-") amt = amt - val*1.0;
rlm@0 36 if (tok == "#") { // record item number
rlm@0 37 if (obj1.item_number) obj1.item_number.value = val;
rlm@0 38 ary[j] = ""; // zap this array element
rlm@0 39 }
rlm@0 40 // Now we do 3-character tokens...
rlm@0 41 if (ary[j].length < 4) continue;
rlm@0 42 tok = ary[j].substring (0,3); // first 3 chars
rlm@0 43 val = ary[j].substring (3); // get data
rlm@0 44 if (tok == "s1=") { // value for shipping
rlm@0 45 if (obj1.shipping) obj1.shipping.value = val;
rlm@0 46 ary[j] = ""; // clear it out
rlm@0 47 }
rlm@0 48 if (tok == "s2=") { // value for shipping2
rlm@0 49 if (obj1.shipping2) obj1.shipping2.value = val;
rlm@0 50 ary[j] = ""; // clear it out
rlm@0 51 }
rlm@0 52 }
rlm@0 53 val = ary.join (" "); // rebuild val with what's left
rlm@0 54 }
rlm@0 55
rlm@0 56 function StorVal () {
rlm@0 57 var tag;
rlm@0 58 tag = obj.name.substring (obj.name.length-2); // get flag
rlm@0 59 if (tag == "1a") op1a = op1a + " " + val;
rlm@0 60 else if (tag == "1b") op1b = op1b + " " + val;
rlm@0 61 else if (tag == "2a") op2a = op2a + " " + val;
rlm@0 62 else if (tag == "2b") op2b = op2b + " " + val;
rlm@0 63 else if (tag == "3a") op3a = op3a + " " + val;
rlm@0 64 else if (tag == "3b") op3b = op3b + " " + val;
rlm@0 65 else if (tag == "4a") op4a = op4a + " " + val;
rlm@0 66 else if (tag == "4b") op4b = op4b + " " + val;
rlm@0 67 else if (tag == "5a") op5a = op5a + " " + val;
rlm@0 68 else if (tag == "5b") op5b = op5b + " " + val;
rlm@0 69 else if (tag == "6a") op6a = op6a + " " + val;
rlm@0 70 else if (tag == "6b") op6b = op6b + " " + val;
rlm@0 71 else if (tag == "7a") op7a = op7a + " " + val;
rlm@0 72 else if (tag == "7b") op7b = op7b + " " + val;
rlm@0 73 else if (tag == "8a") op8a = op8a + " " + val;
rlm@0 74 else if (tag == "8b") op8b = op8b + " " + val;
rlm@0 75 else if (tag == "9a") op9a = op9a + " " + val;
rlm@0 76 else if (tag == "9b") op9b = op9b + " " + val;
rlm@0 77 else if (tag == "3i") itmn = itmn + " " + val;
rlm@0 78 else if (des.length == 0) des = val;
rlm@0 79 else des = des + ", " + val;
rlm@0 80 }
rlm@0 81
rlm@0 82 function ReadForm (obj1, tst) { // Read the user form
rlm@0 83 var i,j,pos;
rlm@0 84 amt=0;des="";op1a="";op1b="";op2a="";op2b="";op3a="";op3b="";op4a="";op4b="";op5a="";op5b="";op6a="";op6b="";op7a="";op7b="";op8a="";op8b="";op9a="";op9b="";itmn="";
rlm@0 85 if (obj1.baseamt) amt = obj1.baseamt.value*1.0; // base amount
rlm@0 86 if (obj1.basedes) des = obj1.basedes.value; // base description
rlm@0 87 if (obj1.baseon0) op1a = obj1.baseon0.value; // base options
rlm@0 88 if (obj1.baseos0) op1b = obj1.baseos0.value;
rlm@0 89 if (obj1.baseon1) op2a = obj1.baseon1.value;
rlm@0 90 if (obj1.baseos1) op2b = obj1.baseos1.value;
rlm@0 91 if (obj1.baseon2) op3a = obj1.baseon2.value;
rlm@0 92 if (obj1.baseos2) op3b = obj1.baseos2.value;
rlm@0 93 if (obj1.baseon3) op4a = obj1.baseon3.value;
rlm@0 94 if (obj1.baseos3) op4b = obj1.baseos3.value;
rlm@0 95 if (obj1.baseon4) op5a = obj1.baseon4.value;
rlm@0 96 if (obj1.baseos4) op5b = obj1.baseos4.value;
rlm@0 97 if (obj1.baseon5) op6a = obj1.baseon5.value;
rlm@0 98 if (obj1.baseos5) op6b = obj1.baseos5.value;
rlm@0 99 if (obj1.baseon6) op7a = obj1.baseon6.value;
rlm@0 100 if (obj1.baseos6) op7b = obj1.baseos6.value;
rlm@0 101 if (obj1.baseon7) op8a = obj1.baseon7.value;
rlm@0 102 if (obj1.baseos7) op8b = obj1.baseos7.value;
rlm@0 103 if (obj1.baseon8) op9a = obj1.baseon8.value;
rlm@0 104 if (obj1.baseos8) op9b = obj1.baseos8.value;
rlm@0 105 if (obj1.baseitn) itmn = obj1.baseitn.value;
rlm@0 106 for (i=0; i<obj1.length; i++) { // run entire form
rlm@0 107 obj = obj1.elements[i]; // a form element
rlm@0 108 if (obj.type == "select-one") { // just selects
rlm@0 109 if (obj.name == "quantity" ||
rlm@0 110 obj.name == "amount") continue;
rlm@0 111 pos = obj.selectedIndex; // which option selected
rlm@0 112 val = obj.options[pos].value; // selected value
rlm@0 113 ChkTok (obj1); // check for any specials
rlm@0 114
rlm@0 115 if (obj.name == "on0" || // let this go where it wants
rlm@0 116 obj.name == "os0" ||
rlm@0 117 obj.name == "on1" ||
rlm@0 118 obj.name == "os1" ||
rlm@0 119 obj.name == "on2" ||
rlm@0 120 obj.name == "os2" ||
rlm@0 121 obj.name == "on3" ||
rlm@0 122 obj.name == "os3" ||
rlm@0 123 obj.name == "on4" ||
rlm@0 124 obj.name == "os4" ||
rlm@0 125 obj.name == "on5" ||
rlm@0 126 obj.name == "os5" ||
rlm@0 127 obj.name == "on6" ||
rlm@0 128 obj.name == "os6" ||
rlm@0 129 obj.name == "on7" ||
rlm@0 130 obj.name == "os7" ||
rlm@0 131 obj.name == "on8" ||
rlm@0 132 obj.name == "os8" ||
rlm@0 133 obj.name == "on9" ||
rlm@0 134 obj.name == "os9") continue;
rlm@0 135
rlm@0 136 StorVal ();
rlm@0 137
rlm@0 138 } else
rlm@0 139 if (obj.type == "checkbox" || // just get checkboxex
rlm@0 140 obj.type == "radio") { // and radios
rlm@0 141 if (obj.checked) {
rlm@0 142 val = obj.value; // the value of the selection
rlm@0 143 ChkTok (obj1);
rlm@0 144 StorVal ();
rlm@0 145 }
rlm@0 146 } else
rlm@0 147 if (obj.type == "select-multiple") { //one or more
rlm@0 148 for (j=0; j<obj.options.length; j++) { // run all options
rlm@0 149 if (obj.options[j].selected) {
rlm@0 150 val = obj.options[j].value; // selected value (default)
rlm@0 151 ChkTok (obj1);
rlm@0 152 StorVal ();
rlm@0 153 }
rlm@0 154 }
rlm@0 155 } else
rlm@0 156 if ((obj.type == "text" || // just read text,
rlm@0 157 obj.type == "textarea") &&
rlm@0 158 obj.name != "tot" && // but not from here
rlm@0 159 obj.name != "quantity") {
rlm@0 160 val = obj.value; // get the data
rlm@0 161 if (val == "" && tst) { // force an entry
rlm@0 162 alert ("Enter data for " + obj.id);
rlm@0 163 return false;
rlm@0 164 }
rlm@0 165 StorVal ();
rlm@0 166 }
rlm@0 167 }
rlm@0 168 // Now summarize stuff we just processed, above
rlm@0 169 if (op1a.length > 0) obj1.on0.value = op1a;
rlm@0 170 if (op1b.length > 0) obj1.os0.value = op1b;
rlm@0 171 if (op2a.length > 0) obj1.on1.value = op2a;
rlm@0 172 if (op2b.length > 0) obj1.os1.value = op2b;
rlm@0 173 if (op3a.length > 0) obj1.on2.value = op3a;
rlm@0 174 if (op3b.length > 0) obj1.os2.value = op3b;
rlm@0 175 if (op4a.length > 0) obj1.on3.value = op4a;
rlm@0 176 if (op4b.length > 0) obj1.os3.value = op4b;
rlm@0 177 if (op5a.length > 0) obj1.on4.value = op5a;
rlm@0 178 if (op5b.length > 0) obj1.os4.value = op5b;
rlm@0 179 if (op6a.length > 0) obj1.on5.value = op6a;
rlm@0 180 if (op6b.length > 0) obj1.os5.value = op6b;
rlm@0 181 if (op7a.length > 0) obj1.on6.value = op7a;
rlm@0 182 if (op7b.length > 0) obj1.os6.value = op7b;
rlm@0 183 if (op8a.length > 0) obj1.on7.value = op8a;
rlm@0 184 if (op8b.length > 0) obj1.os7.value = op8b;
rlm@0 185 if (op9a.length > 0) obj1.on8.value = op9a;
rlm@0 186 if (op9b.length > 0) obj1.os8.value = op9b;
rlm@0 187 if (itmn.length > 0) obj1.item_number.value = itmn;
rlm@0 188 obj1.item_name.value = des;
rlm@0 189 obj1.amount.value = Dollar (amt);
rlm@0 190 if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
rlm@0 191 }
rlm@0 192 //-->
rlm@0 193 </script>
rlm@0 194 <!-- End of Script -->
rlm@0 195 </head>
rlm@0 196
rlm@0 197
rlm@0 198
rlm@0 199 <body>
rlm@0 200
rlm@0 201 Widget Flower Bouquet
rlm@0 202 <!-- Start of Form -->
rlm@0 203 <!-- Note: target="paypal" was replaced with the variable target="_self" -->
rlm@0 204 <!-- Note: shopping_url also added to code -->
rlm@0 205 <!-- These two changes allow better functionality with IE and Firefox -->
rlm@0 206 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target = '_self'; return ReadForm(this, true);">
rlm@0 207 <input type="hidden" name="add" value="1">
rlm@0 208 <input type="hidden" name="cmd" value="_cart">
rlm@0 209 <!--your email address goes here -->
rlm@0 210 <input type="hidden" name="business" value="youremail@youremail.com">
rlm@0 211 <input type="hidden" name="item_name">
rlm@0 212 <input type="hidden" name="item_number" "WFB-1001">
rlm@0 213 <input type="hidden" name="amount">
rlm@0 214 <input type="hidden" name="currency_code" value="USD">
rlm@0 215 <input type="hidden" name="lc" value="US">
rlm@0 216 <input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/your_page.html">
rlm@0 217 <input type="hidden" name="cancel_return" value="http://www.yourwebsite.com/Cancel.html">
rlm@0 218 <input type="hidden" name="return" value="http://www.yourwebsite.com">
rlm@0 219 <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
rlm@0 220
rlm@0 221
rlm@0 222 <!-- -->
rlm@0 223 <input type="hidden" name="baseamt" value="00">
rlm@0 224 <input type="hidden" name="basedes" value="Widget Flower Bouquet">
rlm@0 225 <!-- -->
rlm@0 226 <input type="hidden" name="baseon0" value="Requested Delivery Date">
rlm@0 227 <input type="hidden" name="baseos0">
rlm@0 228 <input type="hidden" name="baseon1" value="Deliver To">
rlm@0 229 <input type="hidden" name="baseos1">
rlm@0 230 <input type="hidden" name="baseon2" value="Phone">
rlm@0 231 <input type="hidden" name="baseos2">
rlm@0 232 <input type="hidden" name="baseon3" value="Address">
rlm@0 233 <input type="hidden" name="baseos3">
rlm@0 234 <input type="hidden" name="baseon4" value="Town/City">
rlm@0 235 <input type="hidden" name="baseos4">
rlm@0 236 <input type="hidden" name="baseon5" value="From">
rlm@0 237 <input type="hidden" name="baseos5">
rlm@0 238 <input type="hidden" name="baseon6" value="Sender Email">
rlm@0 239 <input type="hidden" name="baseos6">
rlm@0 240 <input type="hidden" name="baseon7" value="Sender Phone">
rlm@0 241 <input type="hidden" name="baseos7">
rlm@0 242 <input type="hidden" name="baseon8" value="Message">
rlm@0 243 <input type="hidden" name="baseos8">
rlm@0 244 <input type="hidden" name="baseitn">
rlm@0 245 <!-- -->
rlm@0 246 <input type="hidden" name="on0">
rlm@0 247 <input type="hidden" name="os0">
rlm@0 248 <input type="hidden" name="on1">
rlm@0 249 <input type="hidden" name="os1">
rlm@0 250 <input type="hidden" name="on2">
rlm@0 251 <input type="hidden" name="os2">
rlm@0 252 <input type="hidden" name="on3">
rlm@0 253 <input type="hidden" name="os3">
rlm@0 254 <input type="hidden" name="on4">
rlm@0 255 <input type="hidden" name="os4">
rlm@0 256 <input type="hidden" name="on5">
rlm@0 257 <input type="hidden" name="os5">
rlm@0 258 <input type="hidden" name="on6">
rlm@0 259 <input type="hidden" name="os6">
rlm@0 260 <input type="hidden" name="on7">
rlm@0 261 <input type="hidden" name="os7">
rlm@0 262 <input type="hidden" name="on8">
rlm@0 263 <input type="hidden" name="os8">
rlm@0 264 <input type="hidden" name="on9">
rlm@0 265 <input type="hidden" name="os9">
rlm@0 266 <!-- -->
rlm@0 267
rlm@0 268 <!-- -->
rlm@0 269 Select Size:&nbsp;&nbsp;
rlm@0 270 <select name="Size" onchange="ReadForm (this.form, false);">
rlm@0 271 <option value="Please Choose" selected>Please Choose</option>
rlm@0 272 <option value="Small @25.00">Small - $25.00</option>
rlm@0 273 <option value="Medium @30.00">Medium - $30.00</option>
rlm@0 274 <option value="Large @35.00">Large - $35.00</option>
rlm@0 275 </select>
rlm@0 276 <!-- -->
rlm@0 277 <br><br>
rlm@0 278
rlm@0 279 <!-- Start of Options -->
rlm@0 280 Extras:
rlm@0 281 <br><br>
rlm@0 282 <input type = "checkbox"
rlm@0 283 onclick = "ReadForm (this.form, false);"
rlm@0 284 value = "Wrapper Package +5.00">
rlm@0 285 Hand Tied Ribbon and Bow Wrapper Package - $5.00
rlm@0 286 &nbsp;
rlm@0 287 <br><br>
rlm@0 288 <input type = "checkbox"
rlm@0 289 onclick = "ReadForm (this.form, false);"
rlm@0 290 value = "Chocolates Bites +9.00">
rlm@0 291 1 Lb Box Homemade Dark Chocolates Bites - $9.00
rlm@0 292 &nbsp;
rlm@0 293 <!-- End of Options -->
rlm@0 294
rlm@0 295 <!-- Start of Text Input Fields -->
rlm@0 296 <br><br>
rlm@0 297 Requested Delivery Date:&nbsp;&nbsp;
rlm@0 298 <input type="text" id="Requested Delivery Date" name="deliverydate_1b" size="10">
rlm@0 299 <!-- -->
rlm@0 300 <br><br>
rlm@0 301 Deliver To:&nbsp;&nbsp;
rlm@0 302 <input type="text" id="Deliver To" name="deliverto_2b" size="20">
rlm@0 303 <!-- -->
rlm@0 304 <br><br>
rlm@0 305 Phone:&nbsp;&nbsp;
rlm@0 306 <input type="text" id="Phone" name="phone_3b" size="12">
rlm@0 307 <!-- -->
rlm@0 308 <br><br>
rlm@0 309 Address:&nbsp;&nbsp;
rlm@0 310 <input type="text" id="Address" name="address_4b" size="20">
rlm@0 311 <!-- -->
rlm@0 312 <br><br>
rlm@0 313 Town/City:&nbsp;&nbsp;
rlm@0 314 <input type="text" id="Town/City" name="towncity_5b" size="20">
rlm@0 315 <!-- -->
rlm@0 316 <br><br>
rlm@0 317 From:&nbsp;&nbsp;
rlm@0 318 <input type="text" id="From" name="from_6b" size="20">
rlm@0 319 <!-- -->
rlm@0 320 <br><br>
rlm@0 321 Your Email:&nbsp;&nbsp;
rlm@0 322 <input type="text" id="Your Email" name="semail_7b" size="20">
rlm@0 323 <!-- -->
rlm@0 324 <br><br>
rlm@0 325 Your Phone:&nbsp;&nbsp;
rlm@0 326 <input type="text" id="Your Phone" name="sphone_8b" size="12">
rlm@0 327 <!-- -->
rlm@0 328 <br><br>
rlm@0 329 Message:&nbsp;&nbsp;
rlm@0 330 <input type="text" id="Message" name="message_9b" size="30">
rlm@0 331 <!-- End of Text Input Fields -->
rlm@0 332
rlm@0 333
rlm@0 334 <br><br><br>
rlm@0 335
rlm@0 336 Total Cost:&nbsp; &nbsp;
rlm@0 337 <input class="nbor" type="text" name="tot" size="8" value="$0.00">
rlm@0 338
rlm@0 339 <br><br>
rlm@0 340
rlm@0 341 <input type = "button"
rlm@0 342 value = "Reset FORM"
rlm@0 343 onclick = "this.form.reset();">
rlm@0 344
rlm@0 345 <br><br>
rlm@0 346
rlm@0 347
rlm@0 348
rlm@0 349 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" name="submit" alt="cart add">
rlm@0 350 </form>
rlm@0 351 <!-- End of Form -->
rlm@0 352
rlm@0 353 </body>
rlm@0 354 </html>