How to remove last name from the name field

  • Profile Image
    ascetinteractive
    Asked on December 06, 2012 at 09:34 PM

    I need help on how to remove last name from the name field

  • Profile Image
    abajan
    Answered on December 06, 2012 at 10:31 PM

    Thanks for asking.

    If you're referring to what is displayed in email alerts, please have a look at this thread. Conversely, if you mean that you want to prevent the last name from being displayed on the form, inject the following rule, substituting the correct ID number (highlighted in red) in the selector:

    #last_1, [for=last_1] {
    display: none;
    }

    Attribute selectors don't work in IE6 and below but so few people use that browser nowadays that it's not a major issue. However, if you do need to accommodate such users, substitute the following rule for the above:

    #last_1, #sublabel_last {
    display: none;
    }

    Unfortunately, due to lack of specificity, if the form contains multiple full name fields, that second version would affect the sublabels of all of the form's last name fields, resulting in some pretty awful misalingment.

    Lastly, It should be noted that while the fullname {tag} can be manipulated to display only certain elements, that action has no affect on the submissions records. In other words, a blank "Last Name" column would still be there.

    If you need additional information on anything above, we'd be happy to supply it.

  • Profile Image
    abajan
    Answered on December 06, 2012 at 10:40 PM

    Incidentally, this form illustrates injected CSS being used to hide the last name of its first full name field. If you clone it and go into its injected CSS and comment out the first rule instead of the second, you'll see the misalignment to which I referred.