Auto Capitalize first word of Firstname and Lastname during signup.

Discussion in 'Templates customization' started by adminhumboo, Feb 20, 2012.

  1. adminhumboo

    adminhumboo New Member

    Joined:
    Feb 13, 2012
    Messages:
    5
    Hi,

    We managed to make a script to capitalize the first character of firstname and lastname or any word inputed in the signup form. ( john will automatically John before it will go to database). But my subscribers need to hit two buttons before completing the events.

    First event = clicking sign up button (event for gathering inputed data then will process the capitalization of first character)
    Second event = clicking the another button (event for the the submission of the processes to the database)

    May I ask if there's a way to do this without using this script. I cannot find an option in amemberpro v4.1.12. I really want the ease and convenience for subscribers. Even they will provide their firstname and lastname in all lowercase in the sign up form. When emailing them they must receive with their firstname and lastname with capitalized first letter and also for formality sake.

    Any advice is appreciated.

    ---Thanks
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    There is no ready to use solution,
    And in fact you need to add hook to one event only.
    use onUserBeforeInsert event. It will be fired before actual insert, and you will be able to get full user's record object in your hook.
  3. adminhumboo

    adminhumboo New Member

    Joined:
    Feb 13, 2012
    Messages:
    5
    Updates:

    We are using a java script in the signup form. Below is the code.

    function capitalizeMe(obj) {
    val = obj.value;
    newVal = '';
    val = val.split(' ');
    for(var c=0; c < val.length; c++) {
    newVal += val[c].substring(0,1).toUpperCase() +
    val[c].substring(1,val[c].length) + ' ';
    }
    obj.value = newVal;
    }

    This solved the issue... Every inputted text will auto capitalized after typing... Hope this will help... :)
  4. andrewhorowitz

    andrewhorowitz New Member

    Joined:
    Feb 27, 2012
    Messages:
    3
    How did you implement this on your signup page? Thanks in advance.

Share This Page