> Forums > Active Social > General Discussion > Validate first and Last Name
Last Post 05 Oct 2011 06:36 PM by Jeff Blanks. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Centralhome.com
Customers
Centralhome.com
Post Count:53

--
01 Oct 2011 09:13 PM
    I was just looking at Members List. I see that I have one without a first or last name. I'm using the AS sign up and I thought First & Last were required.

    Is it possible to remove first & last after you sign up?

    I also see that some use space or dot for last name. Is there a simple regex for making sure the first and last are alphabet and 2 characters or more? (I have a friend with only 2 char last name and he gets annoyed when Last Name requires 3 characters!)
    Steven Webster
    Customers
    Steven Webster
    Post Count:1665

    --
    02 Oct 2011 08:42 AM
    I "think" the AS signup is dependent on the required profile field settings in DNN (Admin | User Accounts | Manage Profile Properties). That field allows for regular expression validation. That said....I've never tried it with AS Signup.

    Steven Webster
    dnnOsphere.com, An Independent Community for DotNetNuke Users
    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    02 Oct 2011 09:32 AM
    DNN profile field validation does extend into the AS signup. I've only recently done limited testing with great success. I've got several profile fields I place regex validation on such as phone number, zip codes, url. I also place regex on the AS created profile fields for twitter, fb, etc to force a proper link in those fields.

    Great point on first and last names. I've never thought to force validation on those fields.
    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    Centralhome.com
    Customers
    Centralhome.com
    Post Count:53

    --
    03 Oct 2011 08:52 PM
    Any chance you want to share those regex? I know, simple, but I'm bad at regex. Especially for first/last ...
    e.g. 2 or more alphabet only ...
    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    05 Oct 2011 06:33 PM
    Primary resource I use for URL, zip codes, phone numbers, etc:
    http://msdn.microsoft.com/en-us/lib...50303.aspx

    Specific URL Targeting for validation:
    <br>Facebook, validates profiles and/or pages:<br>(?<img src='http://www.activemodules.com/DesktopModules/ActiveForums/themes/DNN/emoticons/sad.gif' align="absmiddle"  border="0" />http|https):\/\/)?(?:www.)?facebook.com\/(?<img src='http://www.activemodules.com/DesktopModules/ActiveForums/themes/DNN/emoticons/sad.gif' align="absmiddle"  border="0" />?:\w)*#!\/)?(?:pages\/)?(?:[?\w\-]*\/)?(?:profile.php\?id=(?=\d.*))?([\w\-]*)?<br><br>Twitter, validates profiles:<br>(http|https)://(www.twitter|twitter).com/(#!/)?[a-zA-Z0-9_]{1,15}<br>


    I also ran across this one that may be of help to you for firstname/lastname validation:
    http://stackoverflow.com/questions/2385701/regular-expression-for-first-and-last-name

    You can try changing the expression: [a-zA-Z]{3,30}

    To this: [a-zA-Z]{2,30}

    The {2,30} states at least 2 characters up to a maximum of 30. Also take a look at the trailing end of my twitter validation: [a-zA-Z0-9_]{1,15}

    I haven't tested those though. But intent to look into first & last names a bit more myself. If I come up with some good solutions, I'll post back here.

    Also, keep in mind, there are some differences in regex from ASP to PHP. I learned this the hard way. Not all regex expressions work across multiple languages.

    Hope this helps.
    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    05 Oct 2011 06:35 PM
    These didn't come through on that last post:

    Facebook, validates profiles and/or pages:
    (?http|https):\/\/)?(?:www.)?facebook.com\/(??:\w)*#!\/)?(?:pages\/)?(?:[?\w\-]*\/)?(?:profile.php\?id=(?=\d.*))?([\w\-]*)?

    Twitter, validates profiles:
    (http|https)://(www.twitter|twitter).com/(#!/)?[a-zA-Z0-9_]{1,15}
    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    05 Oct 2011 06:36 PM
    ARRRGGHHH!!!!!

    If you want the FB validation, send me a pm.
    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    You are not authorized to post a reply.
    > Forums > Active Social > General Discussion > Validate first and Last Name
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy