java - Change function from to a equal check -


how can change check variable doesn't check if lastnamefield not empty checks if lastnamefield equal lastnamefield?

private boolean isinputvalid() {     string errormessage = "";      if (firstnamefield.gettext() == null || firstnamefield.gettext().length() == 0) {         errormessage += "no valid german word!\n";      }     if (lastnamefield.gettext() == null || lastnamefield.gettext().length() == 0) {         errormessage += "no valid english word!\n";      }        //if (pw.equals(gpw) == true) {     if (errormessage.length() == 0) {         return true;     } else {         // show error message.         dialogs.create()             .title("wrong spelling")             .masthead("please correct!")             .message(errormessage)             .showerror();         return false;     } 

if want method check field equals except of not empty, use this:

if (!"lastnamefield".equals(lastnamefield)){     errotmessage+= "no valid english word!\n"; } 

or aks question correctly, hard understand, want!


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -