March 20, 200818 yr I'm redesigning a site which makes use of the Paypal shopping cart script. The problem is that the code paypal give you is not valid XHTML, so I have changed it so that it validates, but it no longer works properly. I think it's because I removed the attribute target="paypal" but I'm not sure. It still adds the item to the cart, but it no longer opens a new window to do so, and the shopping cart no longer has the continue shopping button... Does anyone know of a way of making this work and validate? Old code and new (valid) code shown below. Thank you Code as provided by paypal <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="image" src="https://www.paypal.com//en_GB/i/btn/sc-but-01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"> <input type="hidden" name="add" value="1"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="name@domain.com"> <input type="hidden" name="item_name" value="Catalogue Item"> <input type="hidden" name="amount" value="20.00"> <input type="hidden" name="buyer_credit_promo_code" value=""> <input type="hidden" name="buyer_credit_product_category" value=""> <input type="hidden" name="buyer_credit_shipping_method" value=""> <input type="hidden" name="buyer_credit_user_address_change" value=""> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="GB"> <input type="hidden" name="bn" value="PP-ShopCartBF"> </form> And my valid version <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <p><input type="image" src="https://www.paypal.com//en_GB/i/btn/sc-but-01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" /> <img alt="add to cart" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1" /> <input type="hidden" name="add" value="1" /> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="business" value="name@domain.com" /> <input type="hidden" name="item_name" value="Catalogue Item" /> <input type="hidden" name="amount" value="20.00" /> <input type="hidden" name="buyer_credit_promo_code" value="" /> <input type="hidden" name="buyer_credit_product_category" value="" /> <input type="hidden" name="buyer_credit_shipping_method" value="" /> <input type="hidden" name="buyer_credit_user_address_change" value="" /> <input type="hidden" name="no_shipping" value="2" /> <input type="hidden" name="no_note" value="1" /> <input type="hidden" name="currency_code" value="USD" /> <input type="hidden" name="lc" value="GB" /> <input type="hidden" name="bn" value="PP-ShopCartBF" /></p> </form>
April 21, 200818 yr why dont you test it with the paypal sandbox? there is no way to know before you test it
April 22, 200818 yr Hey notbanksy, just you make the target="_blank" from target="paypal" and your code will work as it was and will also validate. Here is the code <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <p><input type="image" src="https://www.paypal.com//en_GB/i/btn/sc-but-01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" /> <img alt="add to cart" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1" /> <input type="hidden" name="add" value="1" /> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="business" value="name@domain.com" /> <input type="hidden" name="item_name" value="Catalogue Item" /> <input type="hidden" name="amount" value="20.00" /> <input type="hidden" name="buyer_credit_promo_code" value="" /> <input type="hidden" name="buyer_credit_product_category" value="" /> <input type="hidden" name="buyer_credit_shipping_method" value="" /> <input type="hidden" name="buyer_credit_user_address_change" value="" /> <input type="hidden" name="no_shipping" value="2" /> <input type="hidden" name="no_note" value="1" /> <input type="hidden" name="currency_code" value="USD" /> <input type="hidden" name="lc" value="GB" /> <input type="hidden" name="bn" value="PP-ShopCartBF" /></p> </form>
April 22, 200818 yr Subhajit, that will only validate on a transitional doctype. Notbanksy is probably coding to a strict doctype, so it wouldn't validate.
April 22, 200818 yr Subhajit, that will only validate on a transitional doctype. Notbanksy is probably coding to a strict doctype, so it wouldn't validate. You are right, and I think he too knows target will not validate for Strict Doctype... And in transitional Doctype if the value of target is different from these (_blank, _parent, _self, _top), then the code will not validate.. But above he has not mentioned anywhere the his Doctype is set to Strict
April 22, 200818 yr But above he has not mentioned anywhere the his Doctype is set to Strict True, but if you have a look at the site mentioned in his signature, it's coded to the strict doctype. Which is why I assume he's using strict accross the board.
April 22, 200818 yr True, but if you have a look at the site mentioned in his signature, it's coded to the strict doctype. Which is why I assume he's using strict accross the board. Oops didn't noticed his Signature...
Create an account or sign in to comment