- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 10:49 AM
The user should not be able to submit the form if the email is in incorrect format and prompted to correct it.
PS: I am using the username field above to auto-populate the user's email using catalog client script. Please help! Thanks.
Solved! Go to Solution.
- Labels:
-
Facilities Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 11:07 AM
Hey omkar,
why don't you create Email type variable
The email variable creates a widget for users to enter and select an email address. It accepts only valid email expressions containing @ and domain information.
Example of an email variable
Refer:
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2018 01:03 PM
can you paste your script please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2018 06:46 AM
Thanks for getting back! I just replaced my email field value with yours from the script.
function onChange(control, oldValue, newValue, isLoading) {
g_form.hideErrorBox('door_schedules_email');
if (isLoading || newValue == '') {
return;
}
//Validate the value in the email field is valid
var valid = validateEmail(newValue);
if (!valid)
g_form.showErrorBox('door_schedules_email', getMessage('Invalid email address'));
else
g_form.hideErrorBox('door_schedules_email');
}
function validateEmail(door_schedules_email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(door_schedules_email);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2018 09:49 AM
Hi Darla,
I'm still unable to figure out how to avoid the submit request even if the email is invalid.
Please help.
Here's the script:
function onChange(control, oldValue, newValue, isLoading) {
g_form.hideErrorBox('door_schedules_email');
if (isLoading || newValue == '') {
return;
}
//Validate the value in the email field is valid
var valid = validateEmail(newValue);
if (!valid)
g_form.showErrorBox('door_schedules_email', getMessage('Invalid email address'));
else
g_form.hideErrorBox('door_schedules_email');
}
function validateEmail(door_schedules_email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(door_schedules_email);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 11:07 AM
Hey omkar,
why don't you create Email type variable
The email variable creates a widget for users to enter and select an email address. It accepts only valid email expressions containing @ and domain information.
Example of an email variable
Refer:
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 11:25 AM