Hi ,
in view put this code
<Label text="Email" />
<Input
id="emailInput"
type="Email"
class="sapUiSmallMarginBottom"
placeholder="Enter Email ..."
change="validate"
/>
in controller.js put below code
validate:function()
{
var email = this.getView().byId("emailInput").getValue();
var mailregex = /^\w+[\w-+\.]*\@\w+([-\.]\w+)*\.[a-zA-Z]{2,}$/;
if (!mailregex.test(email)) {
alert(email + " is not a valid email address");
this.getView().byId("emailInput").setValueState(sap.ui.core.ValueState.Error);
}
},
its working in my system i think you will also get it.