Hi,
Tried to find a simple answer that include all the steps to combine / concatenate two fields in a Chronoforms Joomla registration form.
'Firstname' 'Lastname' should form 'Name' (with space in between)(Since joomla only use full name and don't separate these)
[list]I have created the fields, including a hidden field for 'name'
I have tried to place "Custom code" before the Joomla Registration event in "On Submit"[/list]
[list]I have set the Joomla Registration Event parameter "name" to field name.
The form is saying "You must provide your username" on Submit[/list]
Where do I go wrong?
Tried to find a simple answer that include all the steps to combine / concatenate two fields in a Chronoforms Joomla registration form.
'Firstname' 'Lastname' should form 'Name' (with space in between)(Since joomla only use full name and don't separate these)
[list]I have created the fields, including a hidden field for 'name'
I have tried to place "Custom code" before the Joomla Registration event in "On Submit"[/list]
<?php $new_data = JRequest::getVar('firstname').JRequest::getVar('lastname');
JRequest::setVar('name', $new_data);
?>
[list]I have set the Joomla Registration Event parameter "name" to field name.
The form is saying "You must provide your username" on Submit[/list]
Where do I go wrong?
Perfect! Thnx!
For anyone else:
1. Create hidden field 'name' in your form under "Preview"
1a. Also create 'firstname' and 'lastname' fields in "Preview"
2. Create a 'Custom Code' element under "Actions" -
Place in OnSubmit event block - After any Captcha but before "Joomla Registration" element
2a. Insert the following in your "Custom Code" element:
/Akerman
For anyone else:
1. Create hidden field 'name' in your form under "Preview"
1a. Also create 'firstname' and 'lastname' fields in "Preview"
2. Create a 'Custom Code' element under "Actions" -
Place in OnSubmit event block - After any Captcha but before "Joomla Registration" element
2a. Insert the following in your "Custom Code" element:
<?php
$form->data['name'] = "{$form->data['firstname']} {$form->data['lastname']}";
?>
/Akerman
This topic is locked and no more replies can be posted.