(SOLVED)Combine First and Last Name for Registration

gabedaly 12 Jun, 2011
I have on my registration form a custom code box in the "on submit" before the Joomla registration event with the following code:

<?php
$firstname = JRequest::getVar('firstname', '', 'post');
$lastname = JRequest::getVar('lastname', '', 'post');
$name = $firstname." ".$lastname;
JRequest::setVar('name', $name, 'post');
?>

It is giving an error asking for a name

Field names match so what an I doing wrong?
Thanks Gabe
gabedaly 12 Jun, 2011
Wrong code. This was used for vesion 3.2. The right code for vesion 4 is:

<?php
$form->data['name'] = $form->data['firstname'].' '.$form->data['lastname'];
?>
This topic is locked and no more replies can be posted.