It would be possible to make a form that when doing Submit this form save the username and e-mail of the user in a proper table, and once sent the form automatically start downloading a file?
Hi entumas ,
Yes, that is possible, you can save the User ID - or lookup and save the username and email (saving just the ID is usually better). You can use a Download action to download a file - this has to be the last action in the On Submit event.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Do you have any tutorial or article in the blog to see how to save the info in the database?
Hi entumas ,
You use the DB Save action in the form On Submit event. It is straightforward to use. This video may help.
Yes, yesterday after writing I was messing a bit and it is relatively intuitive.
But I can't do everything I want
My website is for registered users only, with this in mind:
1. I want (apart from other data) to be stored in the database the username, email and its id in Joomla!
2. I want that if someone uses this form again, they update the data in the same row of the user and not that a new row is created (as it happens to me now)
3. I would like in one of the columns called "downloads" save information type array that includes 3 values: Object downloaded, version of the object, amount of downloads made of that object
1. Look up the user info and add it to the $form->data array Please see this FAQ
2. Please see this FAQ
3. If you can get the data you can convert it to a string - json-encoding works well and save the result to the database along with the other form data.
I managed to solve point 1 without problem.
But I do not get results with point 2.
I had already looked at this FAQ that you sent me yesterday, but this is for CF4, and the interface does not match.
Can you help me fix this?
The differences between CFv4 and v5 here are fairly small. Which bit is causing you problems?
The steps to follow, I don't know what it means.
In the image for example, only 3 fields appear. In CF5 there are many more fields, and I am not able to see the equivalence between them.
Bob, How can I pass data from one 'custom code' to another?
I have a 'custom code' in the 'On load' event and two in the 'On submit' event
I would like to share data between them
You can add the data to the form in hidden inputs, OR you can use the 'Data to Session' and 'Session to Data' actions to save it to the Joomla! User session; OR if you are loading it from a table then you could re-load it after the form submits.
Can I have 2 forms on the same page?
Yes, but make sure that they have different form and element names to avoid confusion, and there may be some problem with using two Google Captchas on the same page.
My form opens in a modal window. The sending is done by AJAX, to show the response in the modal without reloading the page. So far so good.
The problem I have when I want to reopen the modal/form without reloading the page. The modal shows me the answer.
How can I return/refresh to the form without reloading the page?
Hi entumas ,
I'm not clear what you need to do here . . . if it is to reload the form after it is submitted then you can use an Event Loop as the last action in the On Submit event.
Event Loop as the last action in the On Submit event?
Could you explain a little more, please?
I want the form to be reloaded when the user presses the "close" button that appears in "Display message", after submitting the form. This button is the one that closes the modal window now.
So when the user reopens the modal, the form appears again.
Hi entumas ,
I've no idea - if you are showing the form in a Modal Window then closing the window and then re-opening it should re-load the form - unless you have caching enabled, I guess in that case it might load a cached version of the final page.
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com