Regex remove everything after @ (including @)

Support MB User Profile Regex remove everything after @ (including @)Resolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #42069
    SamSam
    Participant

    Hi - How would I setup a Regex remove everything after @ (including @), like in the link, for display_name on the user's profile. By default, it is setting the value as their full email address.

    Thank you,
    Sam

    #42092
    PeterPeter
    Moderator

    Hello Sam,

    Meta Box does not support adding the JS code to the field settings to adjust the input value like that. You can use the validation to validate the display name input when creating/updating the user profile. Refer to the documentation https://docs.metabox.io/validation/

    #42093
    SamSam
    Participant

    Hi Peter - Thank you for your reply. The JS code was only meant as an example of what I was trying to accomplish. It certainly doesn't need to be JS, by me.

    Any alternatives to accomplishing this within MB parameters?

    And FYI, I'm trying to avoid adding extra input values to keep Registration inputs to the absolute minimum, and thus with the least friction to registration (email & password only).

    Thanks,
    Sam

    #42107
    PeterPeter
    Moderator

    Hello,

    You can try to use the action hook rwmb_{$field_id}_after_save_field to check and re-update the field after saving. If you are not able to complete the task, please create a customization service request https://metabox.io/contact/
    Our development team will help you with an extra fee.

    #42111
    SamSam
    Participant

    Thank you, Peter.

    Regards,
    Sam

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.