javascript - HTML form skips required fields -


when press submit on html code access javascript if haven't entered required field "email". see litte "you need fill this" popup 0.5 seconds before sends me script. need do? seems it's problem in jquery maybe? haris.

 <form class="form-horizontal" role="form">      <div class="form-group">          <label for="inputemail" class="col-sm-3 control-label">epost :</label>          <div class="col-sm-9">              <input type="email" class="form-control" id="inputemail" placeholder="epost" required="required">          </div>      </div>      <div class="form-group">          <div class="col-sm-offset-3 col-sm-3">              <button type="submit" href="javascript:;" class="simplecart_checkout">                  <img src="/images/payson.png" alt="kort">              </button>          </div>      </div> </form> 

website: d-cor.se form in checkout. @ bottom (payson image)

called javascript:

 simplecart({     currency: "sek",     checkout: {         type: "sendform",         url: "http://d-cor.se/payson.php",         method: "post",         currency: "sek"       },     shippingcustom: function () {         if (simplecart.total() > 4500) {             return 0;         } else {             return 0;         }     },      cartstyle: "table",     cartcolumns: [     /* picture (same every product right now) */     /* name */         { attr: "name", label: "produkt" },         { view: "decrement", label: "minska" },         { attr: "quantity", label: "kvantitet" },         { view: "increment", label: "höj" },     /* price */         { attr: "price", label: "pris", view: 'currency' },         { attr: "total", label: "subtotal", view: 'currency' },     /* remove */         { view: "remove", text: "ta bort", label: false }     ]   }); simplecart.bind('beforecheckout', function (data) {     data.email = document.getelementbyid("inputemail").value; }); 

try replace line:

    <input type="email" class="form-control" id="inputemail" placeholder="epost" required="required"> 

with this:

    <input type="email" class="form-control" id="inputemail" placeholder="epost" required /> 

Comments

Popular posts from this blog

multithreading - Exception in Application constructor -

React Native allow user to reorder elements in a scrollview list -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -