Forums

First name & last name in CB registration "name" field

chriscaple 15 Dec, 2008
Quick question - I've got a chronoform linked up to the CB registration plugin (CB 1.1) and currently have the username value going into the CB name field - is it possible to put the user's first and last names into the CB name field instead? Because that's what I have them filling out on the registration form. It would be cool if those could show up in the CB backend user management main list.
Max_admin 15 Dec, 2008
Hi Chris,

assuming the Name field of CB is "name" then add anything in the CB plugin config page for this field then add this code in the onsubmit box and make sure the order is to run this code before the pluging:

JRequest::setVar('name', JRequest::getVar('firstname').' '.JRequest::getVar('lastname'));


assuming your first and last names fields are with the above names!

regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chriscaple 15 Dec, 2008
Dang that was a fast reply!

Thanks - I'll try this out!
chriscaple 05 Jan, 2009
Just got around to trying this. Doesn't work.

I think I set it up right... I have a form... it has firstname and lastname fields... email and password and verify password fields... a couple of other fields... connected to the CB registration plugin... the form was working fine before I tried your suggestion... after I tried it, no data. Users aren't getting written into the database.

I think I followed your instructions correctly - I changed the "name field" in the CB plugin from "username" (which was working) to "name". Then I pasted your code into the "On Submit code - before sending email" area in the form code section of the form. Then I clicked on the RunOrder tab and changed it to run the OnSubmit block first, then plugins. Saved it.

Didn't work.

Then I tried removing the code from the form code tab pasting it into the "Extra before onsubmit code" area on the CB plugin configuration page. Didn't work.

Any suggestions?

Joomla 1.5.7, CB 1.1, latest ChronoForms.
GreyHead 05 Jan, 2009
Hi chriscaple,

I'm not sure about changing 'username' to 'name' - usually they are two different fields.

Did you add <?php ?> tags round Max's code?

Bob
chriscaple 05 Jan, 2009
I did when I tried it in the form section... but not when I tried it on the CB plugin configuration page...
Max_admin 05 Jan, 2009
try it in the "onsubmit after email" as you already changed the order!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.