Wednesday 1 April 2015

Name validation in SAP UI5

Name Validation in form:

<Label text="Name"  />
          <Input value="" id="name" />

 To call a id and to get a value should follow below syntax:
this.getView().byId("name").getValue();

//Name Validation       
       
        var a = this.getView().byId("name").getValue();
       
        if(a=="")
        {
            sap.m.MessageBox.alert("Please Enter Your Name");
        return false;
       
        }
        else if(!isNaN(a))
        {
            sap.m.MessageBox.alert("Please Enter Only Characters");

    return false;
            }


Note - For more properties and events of input go to Explored
       

No comments:

Post a Comment