Concatenate radio and checkbox data into PayPal. |
home page std.css |
All this simple JavaScript (JS) plugin does is to accept the value from checkboxes and radio buttons along with any pricing information, or description data, and concatenate it into various PayPal fields.
We start with the output of the PayPal button factory and make a few changes. Then the JS processes the FORM and adjusts the fields. <view source>) to see what was done.
1a = 1st option field name area (50 chars). 1b = 1st option field data area (200 chars). 2a = 2nd option field name area (50 chars). 2b = 2nd option field data area (200 chars). 3i = item_number field data area (127 chars). .. (Anything else, description area - 127 chars.)
Here is an example of what you may put into the value of an option field of a select...
<option value="Item #A1234 s1=10 s2=8.50 @25.00">...</option>
Setting shipping is a little tricky, in that if you use it in any value field of a select, then you must use it in every value field, even if it is set to zero. Also, don't forget to include the hidden shipping and shipping2 fields in your FORM so they can be stuffed.
It doesn't make much sense to use item number or shipping in checkboxes, but it does in radio buttons...
We are getting a little more sophisticated here by adding an extra argument to ReadForm so the text validation is only done upon FORM submission.
Contact me concerning this article at
paypalhelper@aol.com.
Mention "radio/checkbox" in your note.
Individual help starting at $25.00 for simple JS solutions.