email validation

Email validation in sapui5

Pre-requisites

1.sapui5 framework
2.basic javascript knowledge

Validation of input data is important in every application.Today we will see how to do email validation in sapui5.For this we will make use of regular expressions.regular expressions are a series or sequence of symbols and characters expressing a pattern to be searched for within another string.

Steps
1.Create an input box.


2.attach the validation logic in change event of input box.a change event is fired when a user press enter.
regular expression used for email validation is /^\w+[\w-+\.]*\@\w+([-\.]\w+)*\.[a-zA-Z]{2,}$/.


We made use of setValueState() method to show error state of input box.

sample code goes here.

email validation



If you enjoyed this post, I’d be grateful if you’d help it spread by sharing.Thank you! See you soon

0 comments :

Post a Comment

Powered by Blogger.