mardi 27 novembre 2018

Restricting space at the beginning in sapui5

     if(oEvent.mParameters.value.indexOf(' ')===0) {
                    sap.m.MessageToast.show("Space character is not allowed");
                    oEvent.preventDefault();   
                        return false;
                }

By using this code I have to restrict the whitespaces at the beginning in the input field. I tried a lot, I'm getting the message but it is taking the whitespace. How can I make an input field display only message and it should not take whitespaces.




Aucun commentaire:

Enregistrer un commentaire