Online Tutorials & Training Materials | STechies.com
Register Login
Advertisement

Code for Email id and Phone Number validations in SAP UI5/FIORI.

|| 0

Code for Email id and Phone Number validations in SAP UI5/FIORI.
Stechies

We really need not write code from scratch level, instead we can directly take existing java script code and adjust code as per our screens and implement under function of SAP UI5/FIORI .

For example :

function submitfun( )

var content = oSimpleForm.getContent( );
var emailvalue = content[7].getValue();
var atpos = emailvalue.indexOf("@");
var dotpos = emailvalue.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
sap.ui.commons.MessageBox.alert("Not a valid e-mail address");
}
}


Advertisement
Advertisement