確認函數被調用,但它跳過HTML5驗證,只是重定向。 截至目前該頁面是靜態的,沒有其他驗證。html5驗證和JS
<label> Email :</label>
<input type="email" class="form-control" id="new_email"
placeholder="Enter Email" required autofocus
autocomplete="off" style="width:300px;"/>
<script type="text/javascript">
function submitdetails() {
if(confirm("Do you want to proceed") == true) {
document.write("Creating your Account, please wait...");
setTimeout('window.location = "confirm.html";',5000);
} else {
document.write("Redirecting to home page, please wait...");
setTimeout('window.location = "new_fss.html";',5000);
}
}
</script>
HTML:
<button type="submit" class="btn btn-primary" style="width:100px;margin-left:50px;" onclick="submitdetails();">Submit</button>
有什麼建議?
爲什麼你在那裏有5秒延遲? – Cerbrus 2014-09-26 06:39:04
不知道我是否錯過了一些東西,但HTML5驗證在哪裏? – Richlewis 2014-09-26 06:42:58
它影響什麼? – tankit88 2014-09-26 06:43:37