JavaScript text box input value is null judgment
Verify that the name and date are NOT NULL function Checksave () {var Sname=document.getelementbyid ("Sname"). Value;var stime= document.getElementById ("dateTimePicker1"). Value;var Etime=document.getelementbyid ("Datetimepicker2"). Value;if ( sname== "") {alert ("Name cannot be empty!"); return false;} if (stime== "") | | (etime== "")) {alert ("Start or end time cannot be empty!"); return false;}}
string comparison in Java equals
if ("". Equals (Product.getname ()) ) { if (product.getSmallClassId () == -9999) { Specialvos= specialservice.getspecialvos (Special.getid ()); }else{ Specialvos= specialservice.getspecialvos (Special.getid (), Product.getsmallclassid ()); } }
Non-string type
if (Special.getid () ==null) {Special.setid (IDGENERATOR.INCR (Special.class)); Special.setcreatedate (New Date ()); Special.setcreateuser ((long) 110); Specialservice.savespecial (special); }
in struct
Background String type value if the foreground input box is not filled in empty, then the background is the empty string "", when judged with equals
Background non-string value if the foreground input box is left blank, then the background is null, when judged by = =
This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1677646
Java and JavaScript comparison of hollow values and strings