Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kevinuk84 10 posts 30 karma points
    Apr 06, 2021 @ 16:38
    kevinuk84
    0

    Umbraco 7.7 - Email Validation

    Hi,

    Please excuse my ignorance - I am relatively new to Umbraco development. I have a EditProfile.cshtml Macro Partial with the following code:

    Html.EnableClientValidation();
    Html.EnableUnobtrusiveJavaScript();
    Html.RequiresJs("/umbraco_client/ui/jquery.js");
    Html.RequiresJs("/js/jquery.migrate.1.js");
    Html.RequiresJs("/js/jquery.validate.min.1.19.1.js");
    Html.RequiresJs("/js/jquery.validate.unobtrusive.min.js");
    
    var success = TempData["ProfileUpdateSuccess"] != null;
    

    }

    @NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed@ @Html.RenderJsHere()

    @if (Members.IsLoggedIn() && profileModel != null) {
    if (success) { @* This message will show if RedirectOnSucces is set to false (default) *@

    Profile updated

    }

    using (Html.BeginUmbracoForm<UmbProfileController>("HandleUpdateProfile"))
    {
    
        <fieldset>
    
            @Html.ValidationSummary("profileModel", true)
    
            @Html.LabelFor(m => profileModel.Name)
            @Html.TextBoxFor(m => profileModel.Name, new { @class = "form-control", @data_val = "true", @data_val_required = "Your name is required" })
            @Html.ValidationMessageFor(m => profileModel.Name)
            <br />
    
            @Html.LabelFor(m => profileModel.Email)
            @Html.TextBoxFor(m => profileModel.Email, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => profileModel.Email)
            <br />...
    

    However, the validation that takes place against 'profileModel.Email' does not allow uppercase characters.

    For the life of me, I cannot find the RegEx or data annotation that enforces this validation.

    Any thoughts?

  • Nevin George 12 posts 82 karma points
    Apr 07, 2021 @ 01:40
    Nevin George
    0

    Hi Kevin,

    Have you able to reproduce the same issue by changing the RegEx ?

  • kevinuk84 10 posts 30 karma points
    Apr 07, 2021 @ 08:33
    kevinuk84
    0

    Hi Nevin,

    I don't know where to find the RegEx - I'm hopeful someone on here can point me in the right direction.

    I believe the Email field is part of the Membership class - It isn't a custom field that I have created.

    Regards

    Kev

Please Sign in or register to post replies

Write your reply to:

Draft