Forums

SOLVED - How can this work ??

atg1967 19 Feb, 2012
Hello,

I would like to ask if I can implement the scenario below using chronoforms v4.

I have 1 table in my database:

The table is jos_customers. This table has the customer data carndo, name, email, enabled.

The field enabled has a default value of 0 which means that its not activated.


I want to have a form which will work as an activation form, what i mean is, I want the user to type in his card number, if the card number is found in table and the field enabled is 0 then i would like the form to send him to another form that is a registration form.

The registration form will have the following fields: Name, e-mail, username, password.

The fields name, e-mail, username shall have the name, e-mail from the table and the username to have the card number. Then the user must only type in his desired password.

Once that is done and it has created the user as a registered user, i want the field enabled in the jos_customer table updated to 1.

I have just downloaded and installed chronoforms V4 and have no experience.


Thank you for your precious time.

Alexander.
GreyHead 19 Feb, 2012
Hi Alexander,

This can certainly be done with ChronoForms, but it's not a trivial project - on a scale of 1-10 it's probably around a 4. You will need to know a bit about Joomla! & PHP and a little about database tables.

Start out very simple. Get each form working separately with a minimum number of inputs - one is good. Then when you have the mechanics working go back and add more inputs and bells and whistles.

Bob
atg1967 19 Feb, 2012
Hello again Bob,

thank you for your quick reply,

What i have managed to do up to now is this :

I have created 2 forms ( a1 and a2 )

In form a1 i have a single text field that says enter card number and a submit button.

In the events of this form on submit I have entered the Show form , and it calls a2 ( load form ).

In the a2 form i have the added 6 text boxes:

cardnumber ( readonly )
Name
email
username
password
password2 ( repeat password )

In the events on form a2 on Load i have added the DB Record Loader which works great and it fills my fields with the name and email from my table.
On empty result i send them back to form a1.

At the On submit event i have added the Joomla User Registration and i have mapped with the fields required.

When i click on the submit on form a2 though, the user is not added in the Joomla users and i dont know why this is happening.

Once this is fixed I hope i will be able to put an update procedure to update my table with the value enabled.


Best Regards

Alexander
GreyHead 19 Feb, 2012
Hi Alexander,

The Joomla! Registration action is straightforward so shouldn't cause you any problems. Please drag a Debugger action into the OnSubmit event. That will give you more information about what is happening and if any key info is missing.

You should also add an Event Loop action to the OnFail event of the Joomla! Registration plug-in so that any errors from the registration process ae shown.


Bob
atg1967 19 Feb, 2012
Hello Bob,

Thank you so much for your help, up to now i have managed to make both of the forms work.

If its possible for you to help me on 2 things.

1st thing is when the user types in his card number i want it to find a match ( which it does now ) based on the card number he has entered, but if it is possible to do so only for when the field in the table named enabled is equal to 0 ( means that the card is not enabled yet ).

2nd thing is ... once the registration has been completed, to be able to update my table field called enabled to 1.


Thank you again and Congratulations for this great component and Your great support.

ALexander
atg1967 20 Feb, 2012
Hello again Bob,

I finally managed to get it to work, I really want to thank you for your time and guidance.

Best Regards

Alexander
GreyHead 21 Feb, 2012
Hi Alexander,

Well done :-)

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