We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36fcc83 commit 01e7c9fCopy full SHA for 01e7c9f
Client-Side Components/Catalog Client Script/Email & Phone Format/emailPhone.js
@@ -0,0 +1,24 @@
1
+//onSubmit catalog client script Form restriction
2
+function onSubmit(){
3
+var phone = g_form.getValue('preffered_phone');
4
+var mail = g_form.getValue('email_details');
5
+var phnPattern = /^\d{3}-\d{3}-\d{4}/;
6
+var mailPattern = /^[a-zA-Z0-9._%+1]+@(gmail\.com)$/;
7
+
8
+if( phone && !phone.match(phnPattern))
9
+{
10
11
+alert("Phone number format is not correct");
12
+return false;
13
+}
14
+else if(mail && !mail.match(mailPattern))
15
+ {
16
+alert("Email format is not correct");
17
18
+ }
19
+else
20
21
+ return true;
22
23
24
0 commit comments