Validate Email Format

I have users that are mistyping their email address. Is there a way that forms can validate if it is the correct format prior to submitting the form?

This is a sample from one of the errors:
username#organization.com

Hello @Jamail_Serio,

You can add Masked Input common field to the form and select Email pattern in the field settings.

image

To save the common field value to SharePoint field, use this code:

fd.spBeforeSave(function(spForm) {
    fd.field('Email').value = fd.field('Text1').value
});

Where Email is the internal name of the SharePoint field,
and Text1 is the internal name of the common field.

I don't have pattern in the field settings.

I am using Plumsail 1.8.7

Hello @Jamail_Serio,

I'm sorry, me bad.

I meant the Single-line text field:

image

For which you can select the pattern type or create a custom one.

HI @mnikitina
i try use the format but when save the record, i have the error: Cannot set properties of undefined (setting 'value')

Any idea ?
Best Regards !!

Hello @LuisF,

Welcome to Plumsail Community!
Please share the screenshot of the error.
How do you add formatting to a field? Do you have any custom code on the form?

Hi, Thanks for your help,

I have a common field with the code JS, but the save the form have the error:

fd.spBeforeSave(function(spForm) {
fd.field('Email').value = fd.field('Text1').value
});

The name field on Sharepoint is Email and the common field is Text1.

imagen

@LuisF,

Thank you for the details!

Have you added the Email field to the form?

The field must be present on the form to change its value. You can hide the SharePoint field on the form using the CSS:

.field-to-hide {
    display: none !Important;
}

image

@mnikitina Thank So much!!
Have a nice Day !!

1 Like