There is a form, onsumbit="return func1" hangs on it. In func1 , I have a field check, if the fields are filled - return true , if not - false . When true is returned, the action takes place and the form throws a request to the servlet, and if not, an alert appears. But if, after an alert, I enter the correct data, then submit still does not occur. An alert appears - and that's it.
What can be wrong?
//script <script type="text/javascript"> function ehehe() { if(document.getElementById("creditCardOwner").getAttribute("value").length > 0 && document.getElementById("creditCardNumber").getAttribute("value").length > 0){ alert("good"); return true; } else{ alert("bad"); return false; } } </script> //body <form id="creditCardForm" action="" method="post" onsubmit="return ehehe()"> <div id="creditCardArea"> <p id="bankCartaText">БАНКОВСКАЯ КАРТА</p> <input type="button" id="changeForCreditCard" onmouseenter="return pointerChange1()" onmousedown="edit1()" value="Ред."> <p id="ImyaText">Имя владельца банковской карты</p> <span id="lalala1"><input id="creditCardOwner" name="creditCardOwner" type="text" minlength="5" maxlength="25" onfocus="return deleteText1()"></span> <p id="nomerBankCart">Номер банковской карты</p> <span id="lalala"><input id="creditCardNumber" maxlength="16" name="creditCardNumber" onfocus="return deleteText()" onkeypress='return event.charCode >= 48 && event.charCode <= 57'></span> <input id="CVV" minlength="3" maxlength="3" onkeypress='return event.charCode >= 48 && event.charCode <= 57' pattern="[0-9]{3}" title="Three letters CVV code"> <input type="submit" id="submitChangesButton1" value="сохранить"> </div> </form>