Copied to clipboard

Flag this post as spam?

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

  • Tom Bruce 122 posts 506 karma points
    Aug 10, 2017 @ 10:16
    Tom Bruce

    I am using the registration snippet within Umbraco settings. I would like to remove the Name field. If I comment out the field I receive the following error when creating a new member “Cannot save member with empty name.” Open to ideas...

  • Joshua Lemli 52 posts 234 karma points
    Sep 20, 2017 @ 15:16
    Joshua Lemli

    A simple option would be to fill in the name field with some spoofed value. For my applications, clients usually want "FirstName" and "LastName" and tend not to want a "username". I simply add a JavaScript snippet that sets the form's onsubmit method to a function that grabs the FirstName and LastName fields, concatenates their values, and sets the "Name" input to that value (e.g. "FirstName_LastName").

    Another option is to create your own model+controller for login, although that is significantly more complex.

    The simplest option is just to give the "Name" field a null value and hide it:

    @Html.HiddenFor(m => registerModel.Name, new { @Value = "spoofValue" })
Please Sign in or register to post replies

Write your reply to: