[英]How can I create a text box when I enter words in text box and hit spacebar it has to make entered words into a separate phrase?
[英]How can I make a text box is optional if something entered in another text box?
這是我的表格,我必須接受電話號碼或電子郵件、身份證或護照號碼
在 js/ajax 中檢查驗證的邏輯是什么?
btnsubmit
單擊放置一個條件進行驗證,請查找我的代碼段以獲取更多信息。
$(".btnsubmit").on("click",function(){ if($(".email").val() == "" && ($(".phone").val() == "" || $(".southafricanid").val() == "") && ($(".passport").val() == "" || $(".birthdate").val() == "")) { alert(); } })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> Email :- <input type ="text" class="email" /><br/> Phone:<input type ="text" class="phone" /> South African ID: <input type ="text" class="southafricanid" /><br/> Passport : <input type ="text" class="passport" /> Birth Date :<input type ="text" class="birthdate" /> <br/> <input type ="button" class="btnsubmit" value="Validate" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.