Results 1 to 3 of 3

Thread: Join two fields - member registration

  1. #1

    Default Join two fields - member registration

    Hi,
    I've add custom fields to member registration.
    1. Phone Operator (select)

    Now I've made one more custom field where I would like to join Phone operator and Phone number when the form is submitted. Results would be: In database the Phone Operator and Phone Number should be in that new table field.

    How could be this accomplished?

    Thanks for any help!
    Web design agency - EDsolution.si Izdelava spletnih strani

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Join two fields - member registration

    You could use the createNewUser hook, which triggers on registration.

    The hook needs to be registered in a config file
    Code:
    $GLOBALS['TL_HOOKS']['createNewUser'][] = array('ClassName', 'functionName');
    and the Class added somewhere - so you might need to make a little module to do this.

    ClassName.php
    Code:
    <?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
    
    class ClassName extends Backend
    {  
    
        public function functionName($intId, $arrData)
       {
            $operatorAndPhone = $arrData['operator'] .'-'. $arrData['phone'];	
           $this->Database->prepare("UPDATE tl_member SET newfieldName=? WHERE id=?")
           ->limit(1)
           ->execute($operatorAndPhone,$intId);		
       }
    
    }
    
    ?>

  3. #3

    Default Re: Join two fields - member registration

    Thank you ramjet, for your excelent tips!
    Web design agency - EDsolution.si Izdelava spletnih strani

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •