Forums

concatenate name fields on registration form

samoht 19 Jun, 2009
hello again,

I have a client that simply does not like the name field on the registration form. I kept this because Joomla's jos-users table only has a name field. What I would like to do is have a first name last name on my reg form that I concatentate and save into the name field of the jos_users table. If I am connected to that table and use the joomla reg plugin - will this be possible?

Thanks guys!
GreyHead 19 Jun, 2009
Hi samoht,

The latest beta version of the Joomal Registration Plugin supports this - the Plugin OnSubmit Before box is eanbled and you can put the code in there to concatenate first and last name fields (or anything else). I posted the code for this a few days ago.

Bob
samoht 20 Jun, 2009
Bob,

thanks for the great plugin!
So to concatenate the two field names would I put them both in the 'Name' field name of the "field names" tab?
Do I need to separate them with a comma? or some special syntax?

Thanks again!!
GreyHead 20 Jun, 2009
Hi smahot,

No, you still need to concatenate the values in php - and it probably helps to have a hidden field as a placeholder, See this post for the code.

Bob
samoht 20 Jun, 2009
Thanks Bob,

for some reason I am getting this error:

Fatal error: Call to a member function loadResult() on a non-object in C:\xampp\htdocs\surgimap\components\com_chronocontact\libraries\chronoform.php(244) : eval()'d code on line 33

Any ideas??
GreyHead 20 Jun, 2009
Hi samoht,

That looks like line 33 from the Server-side validation box?

Bob
samoht 20 Jun, 2009
Yes, that is the line:

<?php
/*check if user exist*/
$db =& JFactory::getDBO();
$text =& JRequest::getString('uname', '', 'post');
$sql = "
    SELECT COUNT(*)
        FROM jos_users
        WHERE username = ".$db->quote($text).";";
if ( $debug ) echo "sql: ".print_r($sql, true)."<br /><br />";
$db->setQuery( $sql );
if ( $database->loadResult() != 0 ) {
    return "Username Already Taken:: Please enter another username";
}
?>

But why would this now be not working??
samoht 20 Jun, 2009
OK,

I did not really need that code anyway because I set up ajax checking for those fields. However, now after removing the validation code the form seems to begin to process but it takes me to a 403 Error page? even with debugging on?

any ideas?
I am uploading a simplified reg form that is having the same problem. the only thing this simplified form is missing is the ajax.[attachment=0]test_reg.zip[/attachment]
samoht 22 Jun, 2009
Hi Bob,

I keep getting the 403 error as long as the Joomla reg plugin is active??
any thoughts?
Max_admin 22 Jun, 2009
Hi samoht,

Sorry, when do you get the 403 error exactly ?

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
samoht 22 Jun, 2009
Hi Max,
right after submitting the form.
samoht 22 Jun, 2009
hey Guys,

does the new chronofomrs no longer have
global $cf_just_registered;

If not what should I use to find the id of the person just registered?

ps. this might be my problem since I am saving to several tables using this variable.
Max_admin 22 Jun, 2009
1 Likes
Hi samoht,

yes, the latest one doesn't use this anymore, we are now using:
$MyForm->tablerow["jos_chronoforms_testprofile"]


you can get the variable from the bottom of the auto generated code box!

Regards
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
samoht 22 Jun, 2009
thanks Max,

I think I Solved it. I found the new variables in the plugin - and figured out how to get them. It seems to be working now.

Thanks again.
This topic is locked and no more replies can be posted.