Question & Answer
Question
Where can I find an example of custom JavaScript to validate email address in Cast Iron.
Answer
Below is a JavaScript example to validate an email address:
Input: Parameter of type Text or string containing the email address.
Output: Will return the text string of the email address if it satisfies the regular expression specified. If the email address is incorrect, an empty string is returned.
var elementValue = emailToValidate;
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
if(emailPattern.test(elementValue)){
return emailToValidate;
}
else
{
return '';
}
Historical Number
00001474
Was this topic helpful?
Document Information
More support for:
IBM Cast Iron Cloud Integration
Software version:
7.0.0.1, 6.4.0.1, 6.1.0.3, 5.0.1.7
Document number:
153639
Modified date:
15 June 2018
UID
swg21472012