Hi all,
I've created a registration form in Chronoforms (latest build & J 1.5) and I wish to connect it to Community builder. I have also created the necessary fields in Community Builder.
My problem is that I have tweaked the date field on my registration form to be a combination of three drop down boxes. One for day, month and year. How do I concatenate the result into an acceptable format for the Community Builder plugin?
Secondly, How do I check if a email already exists in Community Builder and display an error?
Assume that the form is composed of 5 components
Name: __________ (text_1)
Email: ______________ (text_2)
Birthday: ______ (select_3) ________ (select_4) ______ (select_5)
Password: ___________ (text_6)
Confirm Password: ______________ (text_7)
I appreciate any feedback.
Cheers,
Digital Master!
I've created a registration form in Chronoforms (latest build & J 1.5) and I wish to connect it to Community builder. I have also created the necessary fields in Community Builder.
My problem is that I have tweaked the date field on my registration form to be a combination of three drop down boxes. One for day, month and year. How do I concatenate the result into an acceptable format for the Community Builder plugin?
Secondly, How do I check if a email already exists in Community Builder and display an error?
Assume that the form is composed of 5 components
Name: __________ (text_1)
Email: ______________ (text_2)
Birthday: ______ (select_3) ________ (select_4) ______ (select_5)
Password: ___________ (text_6)
Confirm Password: ______________ (text_7)
I appreciate any feedback.
Cheers,
Digital Master!
Hi digitalmaster,
What *is* the acceptable format for CB?
You can do this in the OnSubmit Before box - or maybe better the OnSubmit before box of the CB Regsitration plugin.
Bob
What *is* the acceptable format for CB?
You can do this in the OnSubmit Before box - or maybe better the OnSubmit before box of the CB Regsitration plugin.
Bob
Hello Mr. GreyHead,
Thank you so much for your reply.
The date format required by CB is dd.mm.yy. Since the calendar in chronoforms was not too convenient, I decided to use 3 drop down menus/combo boxes. The problem is that the CB Registration plugin requires one field name per cb field (Ex: Username: text_1). How do I concatenate the results from the three combo boxes and display them in one field for the cb registration plugin?
For my second problem, I tried to do that using a modification of a code I found from an earlier post of yours and I ran into problems. I placed this code in the Validation section of the form.
I appreciate any feedback. I've been breaking my head on this for over 24 hrs.
Thanks a ton!
Cheers,
digitalmaster
Thank you so much for your reply.
The date format required by CB is dd.mm.yy. Since the calendar in chronoforms was not too convenient, I decided to use 3 drop down menus/combo boxes. The problem is that the CB Registration plugin requires one field name per cb field (Ex: Username: text_1). How do I concatenate the results from the three combo boxes and display them in one field for the cb registration plugin?
For my second problem, I tried to do that using a modification of a code I found from an earlier post of yours and I ran into problems. I placed this code in the Validation section of the form.
<?php
global $mainframe;
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$email = JRequest::getVar('text_2');
$query = "
SELECT `*`
FROM `#__users`
WHERE `email` = $email ;
";
$db->setQuery($query);
if ($db->loadResult() != "" )
{
echo "Please try another email address.";
}
?>I appreciate any feedback. I've been breaking my head on this for over 24 hrs.
Thanks a ton!
Cheers,
digitalmaster
HI digitalmaster,
You are going to need to concatenate the three parts of the date field using something like:
In the validation code you will need to use the cb table and column names.
Bob
You are going to need to concatenate the three parts of the date field using something like:
<?php
$dd = JRequest::getInt('select_3', '00', 'post');
$mm = JRequest::getInt('select_4', '00', 'post');
$yy = JRequest::getInt('select_5', '00', 'post');
$date = $dd.'.'.$mm.'.'.$yy;
JRequest::setVar('date', $date, 'post');
?>In the validation code you will need to use the cb table and column names.
Bob
GreyHead,
Has anyone ever told you..You're AWESOME!!!!!!
I got both problems fixed.
The first one was resolved with the code you suggested. I pasted it with Form Code (under On Submit Code) and it worked like a charm.
The second code took a little bit of playing around with SQL. I found out that only certain fields are in the CB tables. The rest are in the joomla users tables.
Anyways..In case anyone else fall into the same pit, here is my code to check for duplicate emails during registration.
Once again thanks a ton!!!!!
Cheers,
digitalmaster
Has anyone ever told you..You're AWESOME!!!!!!
I got both problems fixed.
The first one was resolved with the code you suggested. I pasted it with Form Code (under On Submit Code) and it worked like a charm.
The second code took a little bit of playing around with SQL. I found out that only certain fields are in the CB tables. The rest are in the joomla users tables.
Anyways..In case anyone else fall into the same pit, here is my code to check for duplicate emails during registration.
<?php
global $mainframe;
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$input_email = JRequest::getVar('text_1');
$result = "";
$query = "
SELECT COUNT(*)
FROM ".$db->nameQuote('jos_users')."
WHERE ".$db->nameQuote('email')." = ".$db->quote($input_email).";
";
$db->setQuery($query);
$count = $db->loadResult();
if ($count != 0)
{
$result .= "<li>";
$result .= 'This email is in use. Please try another email address.';
$result .= "</li>";
}
return $result;
?>Once again thanks a ton!!!!!
Cheers,
digitalmaster
This topic is locked and no more replies can be posted.
