Below I will share with you a js implementation method for judging that the input box cannot be a space or a null value. It has a good reference value and I hope it will be helpful to everyone.
The example is as follows:
var sno = $('#sno').val(); var sname = $('#sname').val(); if((sno.indexOf(" ") >= 0 || sno == null) || (sname.indexOf(" ") >= 0 || sname == null)){ alert('学号和名称不能为空格或null值'); return; }else{ }
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to deal with display issues before vue rendering (detailed tutorial)
By using ueditor in the vue project (Detailed tutorial)
How to use superagent and cheerio using nodejs crawler
The above is the detailed content of How to use js to determine that the input box cannot be a space or null value?. For more information, please follow other related articles on the PHP Chinese website!