0
複数の選択されたチェックボックスの値(name = "cb1")を1つの文字列に結合する必要があるpaypalチェックアウトフォームを使用しているので、 = "os1")の値です。私はこれを理解しようとする円で回っています。私は非常に小さなJSを知っている!誰か助けてもらえますか?送信前にチェックボックスの値を文字列に結合するスクリプト
<div id="buyform">
<form target="paypal" id="ppform" name="ppform" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="myPPbusinessid">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Form Title">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<div><input type="hidden" name="on0" value="Options"><h5>Options</h5></div>
<div>
<select name="os0" id="os0" required>
\t \t <option value="Chosen Product">Any quantity £10.00 GBP</option>
\t </select>
</div>
<input type="hidden" name="on1" value="Colours">
<div>
<input type="checkbox" name="cb1" value="Red" id="os10" class="thecbox"/><label for="os10"></label>
<input type="checkbox" name="cb1" value="Green" id="os11" class="thecbox"/><label for="os11"></label>
<input type="checkbox" name="cb1" value="Orange" id="os12" class="thecbox"/><label for="os12"></label>
<input type="checkbox" name="cb1" value="Purple" id="os13" class="thecbox"/><label for="os13"></label>
<input type="checkbox" name="cb1" value="Yellow" id="os14" class="thecbox"/><label for="os14"></label>
<input type="checkbox" name="cb1" value="Black" id="os15" class="thecbox"/><label for="os15"></label>
<input type="checkbox" name="cb1" value="Blue" id="os16" class="thecbox"/><label for="os16"></label>
<input type="hidden" name="os1" value="EACH, CHECKED, VALUE, HERE">
</div>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="Options">
<input type="hidden" name="option_amount0" value="10.00">
<input type="hidden" name="option_index" value="0">
<input type="hidden" name="currency_code" value="GBP">
<input type="submit" border="0" name="submit" id="submit" value="Purchase" class="buynow mb0"></form>
</div>
有効な複数の色はありますか?同時に緑と赤で製品を注文することはできますか?もしそうでなければラジオボタンが必要かもしれません。 – James
はい、彼らは好きなだけ多くの色を選択できるようにする必要があります –
Paypalは 'option'のために複数の値を受け入れませんので、JSを使用して値を連結しないとpaypalは最後1つ選択 –