RegEx on Javascript; Checking for instances of one of multiple strings

前端 未结 2 1619
独厮守ぢ
独厮守ぢ 2021-01-27 11:39

I have done a lot of server side form validation but until now, the only client side form validation I have done is to check for null/blank entries (e.g., if (value==\'\'||value

2条回答
  •  长情又很酷
    2021-01-27 12:35

    You can use the code below to check for validation not null, not blank, not undefined and not zero in javascript and jquery.

     function myFunction() {
        var data;  //The Values can be like as null,blank,undefined,zero you can test
    
         if(!(!(data)))
         {
         alert("data "+data);
         } 
         else 
         {
            alert("data is "+data);
        }
    
        }
    

提交回复
热议问题