javascript - html required not being set -
html required not being set inputs. submitting forms using onclick ,not submit input type. form submits without content in input
<form action="ordercomplete.php" method="post"> <div id="supercon"> <?php $url="ordersummary.php"; //left arrow previous page echo"<div id=\"leftb\" onclick=\"location.href='".$url."';\" style=\"cursor: pointer;\">"; echo'<span class="centerer"></span>'; echo'<img class="centered" src="arrows.png">'; echo'</div>'; ?> </div> <!--delivery details --> <div id="conphp"> <p id="centerp">please enter details</p> <p id="conphpp"> >name: <br/> <input type='text' name='name' required/> </p> <p id="conphpp"> >number:<br/> <input type= "text" name="number" required/> <br/></p> <p id="conphpp"> >delivery address:<br/> <textarea name="address" rows="7" cols="80" required></textarea> </p> </div> <!--right arrow made submit form --> <div id="rightb" onclick="javascript:document.forms[0].submit();" style="cursor: pointer;"><span class="centerer"></span> <img class="centered" src="arrows-1.png"> </div> </form>
what problem here? how solve this?
what problem here?
submitting form javascript bypasses html 5 validation.
how solve this?
replace
<div id="rightb" onclick="javascript:document.forms[0].submit();" style="cursor: pointer;"><span class="centerer"></span></div>
with:
<button id="rightb"><span class="centerer"></span></button>
… , css desire make way want.
you should put actual content in too. i'd imagine involve replacing background image <img>
has alt
attribute.
Comments
Post a Comment