mardi 18 juin 2019

Radio Buttons Don't Submit with Number Field Present

I am trying to create a simple web form that consists of a couple of checkbox buttons and a number field. It's submitted with a button. For some reason, when the number input box is present, the form will submit 0.00. If I type something into the number field, it will pass whatever I type, but if I select one of the numbers and leave the input field blank, it submits 0.00. I can't seem to figure out why.

If I remove the code , everything works fine.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
      <div class="donation_container">
        <input name="cmd" type="hidden" value="_donations"> 
        <input name="business" type="hidden" value="info@***.org"> 
        <input name="item_name" type="hidden" value="Donation">
        <input name="no_shipping" type="hidden" value="1"> 
        <input name="no_note" type="hidden" value="1"> 
        <input name="currency_code" type="hidden" value="USD"> 
        <input name="tax" type="hidden" value="0.00"> 
        <input name="lc" type="hidden" value="US"> 
        <input name="bn" type="hidden" value="PP-DonationsBF"> 
        <div class="donate_call_to_action">
          <div class="donate_call_to_action_text">Become ***
          </div>
        </div>
        <div class="donation_buttons">
          <label class="donation_label"> 
            <input name="amount" type="checkbox" value="1000.00">
            <div>$1000</div>
          </label>
          <label class="donation_label">
            <input name="amount" type="checkbox" value="500.00">
            <div>$500</div>
          </label>
          <label class="donation_label">
            <input name="amount" type="checkbox" value="100.00">
            <div>$100</div>
          </label>
          <label class="donation_label">
            <input name="amount" type="checkbox" value="50.00">
            <div>$50</div>
          </label>
          <div class="custom_donation">
            <i>$</i>
            <input name="amount" type="number">
          </div>
        </div>
      </div>
      <div class="donation_button">
        <button type="submit" formmethod="post" class="btn btn-primary" alt="PayPal - The safer, easier way to pay online!" name="submit">Donate</button> 
        <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0">
      </div>
    </form>



Aucun commentaire:

Enregistrer un commentaire