Hello,
I guess this is not possible to do with chronoforms, but asking doesn't hurt🙂
I need a simple form with only email input field, this should create a new user
using as username the first part of the email (before @), generate automatically a random password, and autologin the user after submission.
An email should then be sent to the user with his account details.
I know that there a couple of extensions already able to do this, but I was looking for a more flexible solution using chronoforms.
Thank you,
Nic
I guess the only thing that is not possible with the registration action:
using as name and username the first part of the email (before @)
Ok,
got it working,
it register correctl a new user but it still uses
the full email address for both name and username,
it doesn't only use th epart before @
I attach this form for your reference
what I didi to get it working was just fill in the name and username password
using the "email" value
sorry, I am not very tech savvy :-(
Hi oloccina,
In the Registration action you need to put user_name in the Username and Name boxes.
Bob
great, that didi the trick!
another issue that cime to my mind is that many people register using info@...
as their email address, thus the generated usernames would be all the same,
could you tell me where can I find another code snippet that can check if the username
is already existing and in case add numbers after it, like info1, info2, info3 ?
Thank you!
Thanks Bob,
I'll get more help on stackoverflow
for debugging the code,
but I really appreciated you taking the time to post it.
I am now managing all of my many forms with Chronoforms
and I am always impressed at how flexible it is :-)
Tested!
this is the error I receive when filling the form with
an email like info@mydomain.com
1064
YOU HAVE AN ERROR IN YOUR SQL SYNTAX; CHECK THE MANUAL THAT CORRESPONDS TO YOUR MYSQL SERVER VERSION FOR THE RIGHT SYNTAX TO USE NEAR ''INFO%''' AT LINE 3 SQL=SELECT `USERNAME` FROM `#__USERS` WHERE `USERNAME` LIKE 'INFO%'' ;
Hi oloccina,
It did need debugging - there was an extra quote ' after the % - there should be one, not two.
Bob
working like a breeze now, thank you!