jQuery validate plugin on DIV

前端 未结 5 1934
太阳男子
太阳男子 2020-11-29 08:29

I am trying to use the validate plugin on a div as shown in the answer to this question:



        
5条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 08:39

    //HTML
    
    
    //Java Script $("#getOtp").click(function(){ jQuery(document).ready(function(){ var MobileNo = jQuery("#mobileNo").val(); var MobileNoLength = MobileNo.length; var zipRegex = /^\d{10}$/; var mobileNo = $("#mobileNo").val(); if (!zipRegex.test(MobileNo)) { jQuery('#mobileno_message').show(); } else { // success! jQuery('#mobileno_message').hide(); $.ajax({ type : 'POST', url : '', data : {Otp_MobileNo:mobileNo,}, dataType : 'json', beforeSend: function() { $("#error").fadeOut(); }, success : function(response) { alert(response.message_text); $("#check-otp").delay().animate({ height: 'toggle', }, "slow"); $("#getOtp").hide(); } }); } }); });

提交回复
热议问题