I've just installed Chronoforms V3 on Joomla 1.5.7 in legacy mode. I have set up a form and it is working perfectly (YAY!).
I presumed that using the Joomla Plugin would replace my chosen form with the Joomla Registration...is this not the case?
If it is then what am I missing because I still have the default Joomla registration form in place and if this isn't what it's for then can you let me know it's purpose.
Thanks in advance!
:mrgreen:
The Joomla Registration Plugin lets you use your own ChronoForms form for user registration. That way you have more control over the form and you can also collect some extra info and seve it in a separate table if you wish.
You have to supress the standard registration yourself - there are some instructions for that in the forums I think.
Bob
:mrgreen:
I was hoping that new accounts would receive an activation email like they would get registering in the Joomla registration - but I see this is not the case.
or am I completely missing something?
As far as I recall you can set up an email as you would with a normal ChronoForms form. Check the tutorial in the Downloads section - that gives more detail.
Bob
Thanks!
:mrgreen:
So I read your tutorial (clear as always, guys, let me know that so far you are the best in terms of assistence for Joomla... I get even a better feedback that from official site!!!๐ฒ )
.. oh yeah, tutorial about plugin Joomla registration.
I have still to test it true, but one question: is the plugin extending as well the db table where the data are stored
I mean, is it possible to extend the jos_user db table with other fields by simply adding more input fields in the form ?
No, I'm pretty certain that CF doesn't alter the structure of the Joomla core tables. That would make upgrades too messy.
Instead you can put extra fields on your form, save them in a CF table using the user_id as an index and then join the two together when you need to use them.
Bob
Instead you can put extra fields on your form, save them in a CF table using the user_id as an index and then join the two together when you need to use them.
So I tried the following.
I created a form register", like the tutorial said.
I created a table for that: jos_chronoform_register.
Since the form is linked to the Jregistration plugin, the data are stored anyway in jos_user.
So: how to extend the form wiht more data? is it possible, with the same query, to send part of the data to one table (text_0 ... text_4 to jos_user and the rest (let's say meta of the user, fields meta_1...meta4) to a jos_chronoform_register?
Second question.
Which command for a query in sql should I use, to make a check if the user is currently registered, before the user can access to another form in a registered access section?
Which command to send some data from field in jos_user to a jos_chronoform_table, after the user click submit, and the system verified the user is subscribed?
Thanks... a lot! ๐
first question, select the jos_chronoforms_register table in the DB connection tab and enable the connection.
2nd one, use this code at any form to check if a user is logged in:
<?php
$user = JFactory::getUser();
if($user->id){
//do something or nothing, is logged in
}else{
echo "you are not logged in";//show login message
return;//don't display the form
}
?>
Regards
Max
But perhaps I report a bug:
I want to use the functions for the class Juser (sorry if the words maybe are not correct)
(Forum users, have a nice look at: http://www.jlleblanc.com/joomla/Tutorials/JUser_tutorial_for_Joomla!_1%115/)๐
Since I wanted to insert the data concerning the user in my cf_table, I was trying to modify the autogenerated code... but when I save it, there are no savings at all!...
Your CF is really nice, because I saw that actually it does half of the job.
Here's the autogenerated code:
<?php
if($paramsvalues->dbconnection == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_photocontest2", "Table");
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );
if (!$row->bind( $post )) {
JError::raiseWarning(100, $row->getError());
}
if (!$row->store()) {
JError::raiseWarning(100, $row->getError());
}
global $row_jos_chronoforms_photocontest2;
$row_jos_chronoforms_photocontest2 = $row;
}
?>
I want to add:
JRequest::setVar( "cf_user_name", JRequest::getVar( "cf_user_name", $user->name, "post", "string", "" ));
but I cannot save it...๐คจ
Regards,
Max
add this to the onsubmit before email if you have emails running or to the onsubmit after email!
Yes I did like that, it works, but so what's the difference with the autogenerated code?
And is not possible to change it?
For example, I cannot delete it, that makes a bit strange for me: I have a code after submitting that is practically the same with the autogenerated one... which is not possible to delete..๐คจ
Regards
Max
so everything is working fine now, just I guess the last issue.
I followed the tutorial, and I am at this point:
A finishing touch - Directing users away from the regular registration page
Once you have created the new registration page and have tested it to ensure it is working properly*, you need to ensure that users don't end up at
the old (regular) registration page. To do this, one file needs to be altered (ensure you've made a backup copy of this file first).
The file can be found at: components\com_user\views\register\tmpl\default.php
You need to alter the code at the very beginning of the file, so that....
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
Is changed to....
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$mainframe->redirect('chronoforms_url');
?>
For example, if you want to move the users away from "http://www.yourdomain.com/index.php?option=com_user&task=register to
http://www.yourdomain.com/register.html, the code would be....
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$mainframe->redirect('register.html');
?>
Building
So locally everything is ok and working fine:
I just replace:
register.html
with:
index.php?option=com_chronocontact&chronoformname=Register
Instead, on the web site on air the redirect does not work.
Not that I have SEO enabled.
I even have tried to insert the whole link:
http://mysite/index.php?option=com_chronocontact&chronoformname=Register
So I was thinking to take the problem from another point:
use the plugin for displaying the form within an article.
But the article with the registration form will not available from any menu, so I don't know how the URL will be rewrited..
http://mysite/?/register
Any help?
It would be the final part!!๐
http://mysite/index.php?option=com_chronocontact&chronoformname=Register
is display correctly the registration form, even with SEF enabled.
http://mysite/component/user/?task=register#content
Regards
Max
Here the code in my file: components\com_user\views\register\tmpl\default.php for allowing redirect in registration form to a "register" form made in CF:
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$mainframe->redirect('index.php?option=com_chronocontact&chronoformname=Register');
?>
<script type="text/javascript">
<!--
Window.onDomReady(function(){
document.formvalidator.setHandler('passverify', function (value) { return ($('password').value == value); } );
});
// -->
</script>
<?php
if(isset($this->message)){
$this->display('message');
}
?>
<form action="<?php echo JRoute::_( 'index.php?option=com_user' ); ?>" method="post" id="josForm" name="josForm" class="form-validate">
<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
<div class="componentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
<?php endif; ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td width="30%" height="40">
<label id="namemsg" for="name">
<?php echo JText::_( 'Name' ); ?>:
</label>
</td>
<td>
<input type="text" name="name" id="name" size="40" value="<?php echo $this->user->get( 'name' );?>" class="inputbox required" maxlength="50" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="usernamemsg" for="username">
<?php echo JText::_( 'Username' ); ?>:
</label>
</td>
<td>
<input type="text" id="username" name="username" size="40" value="<?php echo $this->user->get( 'username' );?>" class="inputbox required validate-username" maxlength="25" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="emailmsg" for="email">
<?php echo JText::_( 'Email' ); ?>:
</label>
</td>
<td>
<input type="text" id="email" name="email" size="40" value="<?php echo $this->user->get( 'email' );?>" class="inputbox required validate-email" maxlength="100" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pwmsg" for="password">
<?php echo JText::_( 'Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-password" type="password" id="password" name="password" size="40" value="" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pw2msg" for="password2">
<?php echo JText::_( 'Verify Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-passverify" type="password" id="password2" name="password2" size="40" value="" /> *
</td>
</tr>
<tr>
<td colspan="2" height="40">
<?php echo JText::_( 'REGISTER_REQUIRED' ); ?>
</td>
</tr>
</table>
<button class="button validate" type="submit"><?php echo JText::_('Register'); ?></button>
<input type="hidden" name="task" value="register_save" />
<input type="hidden" name="id" value="0" />
<input type="hidden" name="gid" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
As said, the redirect is not working...SEF enabled, I don't know if it matters.
Please help it is quite urgent.. site to be launched soon!๐ฒ
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
global $mainframe->redirect('index.php?option=com_chronocontact&chronoformname=Register');
?>
<script type="text/javascript">
<!--
Window.onDomReady(function(){
document.formvalidator.setHandler('passverify', function (value) { return ($('password').value == value); } );
});
// -->
</script>
No, no, no . . .
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
global $mainframe;
$mainframe->redirect('index.php?option=com_chronocontact&chronoformname=Register');
?>
Bob
..oh it is really sad...
your suggestions are not working this time ?!
the link for create a new account (No Account Yet? Create an account) in the module login is still that one:
http://mysite/component/user/?task=register#content
I don't get the point.
Again, this is the file:
default.php which is in:
components/com_user/view/tmpl/
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
global $mainframe;
$mainframe->redirect('index.php?option=com_chronocontact&chronoformname=Register');
?>
<script type="text/javascript">
<!--
Window.onDomReady(function(){
document.formvalidator.setHandler('passverify', function (value) { return ($('password').value == value); } );
});
// -->
</script>
<?php
if(isset($this->message)){
$this->display('message');
}
?>
<form action="<?php echo JRoute::_( 'index.php?option=com_user' ); ?>" method="post" id="josForm" name="josForm" class="form-validate">
<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
<div class="componentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
<?php endif; ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td width="30%" height="40">
<label id="namemsg" for="name">
<?php echo JText::_( 'Name' ); ?>:
</label>
</td>
<td>
<input type="text" name="name" id="name" size="40" value="<?php echo $this->user->get( 'name' );?>" class="inputbox required" maxlength="50" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="usernamemsg" for="username">
<?php echo JText::_( 'Username' ); ?>:
</label>
</td>
<td>
<input type="text" id="username" name="username" size="40" value="<?php echo $this->user->get( 'username' );?>" class="inputbox required validate-username" maxlength="25" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="emailmsg" for="email">
<?php echo JText::_( 'Email' ); ?>:
</label>
</td>
<td>
<input type="text" id="email" name="email" size="40" value="<?php echo $this->user->get( 'email' );?>" class="inputbox required validate-email" maxlength="100" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pwmsg" for="password">
<?php echo JText::_( 'Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-password" type="password" id="password" name="password" size="40" value="" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pw2msg" for="password2">
<?php echo JText::_( 'Verify Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-passverify" type="password" id="password2" name="password2" size="40" value="" /> *
</td>
</tr>
<tr>
<td colspan="2" height="40">
<?php echo JText::_( 'REGISTER_REQUIRED' ); ?>
</td>
</tr>
</table>
<button class="button validate" type="submit"><?php echo JText::_('Register'); ?></button>
<input type="hidden" name="task" value="register_save" />
<input type="hidden" name="id" value="0" />
<input type="hidden" name="gid" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
plugin activated.
I found the following.
I have in my template (for users, it is derived from Beez) the mod_login folder.
Inside I modified the default.php to be:
<?php echo JText::_('No account yet?'); ?>
<a href="<?php echo JRoute::_('index.php?option=com_chronocontact&chronoformname=Register'); ?>">
<?php echo JText::_('Register'); ?></a>
(replacing index.php?option=com_user&task=register#content)
Now for creating a new account the user is redirected to the form.
Anyway, I still would prefer to follow what is written in your tutorial, cause it looks more neat (modifying only in one place, not all around..)
What do you think?
I report even this:
I tried to register a user with the same email of another one, through the registration form I created (Register)
The system report the message that the email is already chosen, consequently no email for activating the account is sent.
Instead, a customized email I placed for this form is sent.
This can generate confusion.
Is there a way to make a check in the Register form, so that if NO email for activating a new account is sent, NO welcome messages POST form will be displayed, and NO customized email will be sent.
..mmm Mumble mumble..
Can you please list all the problems you have at the moment in points and I will try to help!
Best regards
Max
I inserted the line code as suggested in the tutorial for the plugin registration.
The thing was working locally, not in the online site: the old link on "create a new account" is maintained.
So to bypass the problem I change directly the link for "Create a new account", in the file templating the login module in Beez template (beez>html>mod_login>default.php)
Like this, it works.
Still, I would like to understand why the redirect to the Register form is not working, and solve it, because it would be a more neat solution.
And even because it should work๐
Regards
Max
This might sound stupid but..
Is it really that necessary to redirect?
I created the form and linked in my menu, just choose "ChronoForm" in the "type" and type in your form name. And that's it, wheres the issue?
Maybe there is an issue and I didn't find it yet ๐ฒ
But when you use the form, the joomla default registration can be disabled, so when you try to access by com_user on the URL it won't work.
Other than that, you just need a login form (I use yootools login).
To me the REAL issue with this is when you need to check if the passwords match, if it doesn't match it comes back to the form with the fields empty. Now that's a serious usability problem. Do you have any idea how can I work around on this?
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=3&t=12011
You can use the server side validation and enable the "try to reload" data option at the "anti spam" tab to check that passwords match before anything, or you can use only 1 password field in your form!
Regards
Max
I've written a code snippet to check for matching password fields and also to do some simple validation on the password field.
For these to work correctly, the 'username' field *must* have an id of 'username' and the password field an id of 'password'. You will also need to add the classes 'validate-password' to the password field and 'validate-equalto-password' to the password2 field.
In the Form JavaScript field you need to add this code which adds the extra validation checks to MooValidation.js. The current checks are[list=][*]The password must be 7 characters or more[*]It can't be the same as the username[*]It can't be any of 'password','PASSWORD','1234567', or '0123456'[/list]You can edit these or add more if needed.
Validation.add('validate-password', 'Your password must be . . .',
function(v,elm) {
if (elm.length < 7) return false;
var bad_pass = new Array('password','PASSWORD','1234567','0123456');
for ( i = 0; i <= bad_pass.length; i++ ) {
if (elm.toString() == bad_pass[i] ) return false;
}
var username = $('username').value.toString();
if ( username.length > 0 && username == elm.value.toString() ) return false;
return true;
});
Validation.add('validate-equalto-password', 'This must match the password field',
function(v,elm) {
if (elm.value.toString() == $('password').value.toString() ) return true;
});
NB Validation must be turned 'On' in the Validation Tab.Here's an example of a simple set of Form HTML to show the code needed.
<div class="form_item">
<div class="form_element cf_input">
<label class="cf_label">Username</label>
<input class="cf_inputbox required" maxlength="150" size="30" id="username" name="text_0" type="text" value="">
</div>
<div class="clear">ย </div>
</div><div class="form_item">
<div class="form_element cf_password">
<label class="cf_label">Password</label>
<input class="cf_inputbox validate-password required" maxlength="150" size="30" id="password" name="text_1" type="text">
</div>
<div class="clear">ย </div>
</div>
<div class="form_item">
<div class="form_element cf_password">
<label class="cf_label">Confirm password</label>
<input class="cf_inputbox validate-equalto-password required" maxlength="150" size="30" id="text_2" name="text_2" type="text">
</div>
<div class="clear">ย </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="submit" type="submit">
</div>
<div class="clear">ย </div>
</div>
The attached form .cfbak file can be restored into ChronoForms v3.0 to demonstrate this.Bob
PS I've discovered that the Validation.add() function works well with MooValidation but I can't get Validation.addallofthese() or the options to work yet. I'll report back if I do.
Great one, everybody needs this, thank you!๐
Merry Christmas!
Max
I couldn't figure out why ?
any suggestions Thanks
I am trying to follow the tutorial in order to set up a registration form. however i am having problems with the activation email:
first i followed the tutorial straight through, and no emails would get sent at all. i went back to the joomla registration link in chronforms, changed the "Email user?:" to Yes (instead of no) and now the email is being sent.
but... in the activation email, the password field is empty.
What can i do?
thanks,
jpearl
use the attached plugin file instead of yours!
Regards
Max
I get "Validation is not defined" in firebug console.
Chronoforms 3.1 RC5.5
Form displayed via plugin V3.1 RC5.2 inside article.
No javascript conflicts i can see (no other frameworks loaded) and validation is working on other elements.
I have dropped all chronoforms JS (and CSS) in favour of jquery solutions in my latest sites. However this is an old site.
Please advise how to get additional custom validation methods to work.
This is a long and old thread -- I don't know which post you are responding to. What's the actual problem?
"Validation is not defined" sounds like a message from the old MooTools based validation??
Bob
I found myself in this thread from a link in the FAQ under the 'Chronoforms form validation' heading.
It is possible to extend Andrew's script by writing additional validation tests and including them in the Form JavaScript. See this forum post for an example.
linking to http://www.chronoengine.com/forums.html?cont=posts&p=20043#p20043
Validation is not defined is the error produced when I try to use Validation.add
What is the current method for adding custom validation rules?
A year or so ago ChronoForms used Andrew Tetlaw's 'Really Easy Validation' (in Prototype and MooTools versions originally); hence the reference to Andrew. Last year some time Max switched to using LiveValidation.
You can apply a custom LiveValidation like this:
window.addEvent('load', function() {
var email_val = new LiveValidation('email', {
validMessage: 'Perfect, well done!',
onlyOnSubmit: true
});
email_val.add(
Validate.Presence, {
failureMessage: 'Oops! An email is needed.'
});
email_val.add(
Validate.Email, {,
failureMessage: 'Failed! Invalid email.'
});
});
This is validating a field with the id 'email' for both Presence (i.e. required) and valdi email. See the LiveValdiation docs for more validations.Bob
I want to add redirect in this form.
<form action="index.php?option=com_holzfuss" method="post" id="josForm" name="josForm"><input value="" style="float: left;" border="0" type="image" /><input name="task" value="Add" type="hidden" /><input name="id" value="50" type="hidden" /><input name="category" value="hotel" type="hidden" /></form>
Please help.
Thanks
Shahzad