Forums

chronoforms and cb validating + fill database

blekkie 19 Aug, 2009
Hi,

Have bought the component - works great but can use some directions for our programmer which isn't familiar with chronoforms yet...

I am testing chronoforms for registering users to community builder and fill some database fields from an other component.
but have a couple of questions.

The cb registering plugin works sofar.....but
I have tried to register an user twice with the same mail adress
.. like the original CB register form does, i expected a notice that the E-mail adress was allready registered.

My question: is this kind of validation incorparated in the CB plugin
or should this validation somehow be programmed in otherwise ?
If it is possible where should it be incorparated?


Second question:

I want to use one form which registers a new user in community builder and fills at the same time
some database fields of a component which needs registration originaly.
( the workflow of registering first is not custumor friendly) therfore we want to use chronoforms to
merge both actions in one form)

To fill the component i guess our programmer needs a user id.
is it possible to use for example a dynamic user id - which will be used by the cb plugin?
if yes where should this be incorparated.

then at last (if user id is know) the database fields of the other component can be filled.
where should our programmer fill in the code to do so ??

example of our form thusfar
http://www.klusjes.nl/index.php?option=com_chronocontact&Itemid=86


Best regards...
Blekkie
GreyHead 19 Aug, 2009
Hi blekkie,

The CB Plugin is now fairly old and probably due for a re-write to use more of teh ChronoForms features. (Unfortunately neither Max who wrote this, nor I are CB users.)

As far as I recall the Plugin more or less replicates the CB Registration process and I think you should get error messages. They will I think be Joomla system messages so it's important that your template will display these.

Technical stuff for your programmer. Once the Joomla/CB registration is complete the new user id is available in the current user sesson and I think in the JUser object. You can retrieve it from either of these to use for the second component registration. The difference from this newly registered user and an activated user is that Juser->block is set to true.

How to register with the other component depends on how it is set up, probably the easiest way to so add a db write into the OnSubmit after box of your form.

Bob
blekkie 22 Aug, 2009
i have figured out the validation proces thanks to Deamonhunt

check this link
http://www.joomlapolis.com/index.php?option=com_joomlaboard&Itemid=38&func=view&catid=88&id=108772#108772

one question remains - if for example a username allready exists - this user gets a warning
but has to fill in the form all over again.

is there a way to keep the submitted input in the form when validation gives an error?


Technical stuff for your programmer. Once the Joomla/CB registration is complete the new user id is available in the current user sesson and I think in the JUser object. You can retrieve it from either of these to use for the second component registration. The difference from this newly registered user and an activated user is that Juser->block is set to true.



How should the programmer retrieve the new user id from the current session or Juser object to use in the same form?
I have choosen not to work with an activation E-mail Therefore the Juser block is automaticly set to false...

could it be possible to work with a pre-filled user id in the form with c plugin.
For example for every submit use latest user id +1

In this way nothing has to be retrieved....and the database fields for the second component can be filled at the same time...
GreyHead 22 Aug, 2009
Hi blekkie,

There's a 'Try to Republish' option on the Form General Tab that will have ChronoForms do its best to re-display entered form values.

I'm pretty certain that you can access the new User data with $user =& JFactory::getUser(); You cannot assume safely that last-Id + 1 will work :-( Two people register at the same time and you get into a knotty mess.

Bob
blekkie 22 Aug, 2009
great option 🤣
i overlooked that one
This topic is locked and no more replies can be posted.