A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Input email field as type="email"?

Vote:
 

Hi!

When I create a Optimizely Form and selects that the input is an email, the input is still rendered as type="text" and not type="email", can that be fixed?

Having an email input without type="email" is not ok if you want to follow the accessability rules.

/Kristoffer

#339902
Aug 08, 2025 8:01
Vote:
 

I think we can do it by customizing the TextboxElementBlock.cshtml a bit. 
Here are my steps:
1. Copy the TextboxElementBock.cshtml from \_protected\EPiServer.Forms\EPiServer.Forms.zip\Views\ElementBlocks to under /Views/Shared/ElementBlock folder.
2. In the copied view, we will check if the Model.Validators contains the "EmailValidator", it should be the Email element, and we will change the type to "email" instead of "text".

#339956
Aug 14, 2025 8:18
Vote:
 

That is perfect!

Is it something you will consider adding in a feature release? The fix below will work until I upgrade and Episerver.Forms will be overrtitten.

Thanks!

/Kristoffer

#339957
Aug 14, 2025 8:19
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.