Is it possible to check for null value in a text box in applab?

206 Views Asked by At

I am making an app in Applab. I made a login page but the create id button works even if there is no value or text in the text box. I wanted to make it the way that if the user clicks the create id button he would not be redirected to the next but a message would be displayed to enter values in all the boxes..

1

There are 1 best solutions below

0
On

If you create an element without any text, it'll set the text to "undefined" as a string. Instead, set the text of the element to "":

textInput("inputid", "");
onEvent("buttonid", "click", function () {
  if (getText("inputid").length > 0) {
    // code
  } else {
    // code
  }
});