https://files.cnblogs.com/files/php-qiuwei/sweetalert.min.js
https://files.cnblogs.com/files/php-qiuwei/sweetalert.css
1 <form action="" method="post" id="regForm"> 2 <div> 3 <div class="log_tex"> 4 <label style="font-size: 0.14rem;">认筹ETH数量</label> 5 <input type="text" name="buynum" id="buynum" onkeyup="duihuan()" onfocus="this.value='';" autocomplete="off"/> 6 <!-- <input type="text" placeholder="ETH数量" name="username" id="username"> --> 7 </div> 8 <div class="log_tex"> 9 <label style="font-size: 0.14rem;">本人ETH钱包</label> 10 <input type="text" name="selfaddress" id="selfaddress" autocomplete="off"/> 11 <!-- <input type="password" placeholder="本人ETH钱包" name="password" id="password"> --> 12 </div> 13 <div class="log_tex"> 14 <label style="font-size: 0.14rem;">官方ETH钱包</label> 15 <input type="text" name="guanfangaddress" id="guanfangaddress" /> 16 <div style="text-align:center;"></div> 17 <!-- <input type="password" placeholder="官方ETH钱包" name="repassword" id="repassword"> --> 18 </div> 19 20 <div class="log_go" style="margin-top:0px;"> 21 <button style="background:#54A0E1;color:#fff;"> 22 <span><a href="javascript:void (0)" onclick="register()" >确认</a></span> 23 </button> 24 25 </div> 26 </div> 27 </form> 28 29 <script> 30 function register(){ 31 var guanfangaddress = $("#guanfangaddress").val(); 32 var buynum = $("#buynum").val(); 33 var selfaddress = $("#selfaddress").val(); 34 35 if(buynum=='' || buynum.replace(/s/g,'') =='' || isNaN(buynum) || buynum<=0 ){ 36 swal("失败", "请填写数量", "error"); 37 return; 38 } 39 if(selfaddress=='' || selfaddress.replace(/s/g,'') =='' ){ 40 swal("失败", "请填写地址", "error"); 41 return; 42 } 43 if(guanfangaddress==''){ 44 swal("失败", "请填写官方地址", "error"); 45 return; 46 } 47 48 49 $("#regForm").submit(); 50 } 51 </script>