Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Redirect to the detail after form sent

More
2 months 3 weeks ago #10040 by qms
Hello,
is it possible to redirect after successful form submit to the detail of that last submitted form?
i hope this question is understandable as English is not my native

Thank you
 

More
2 months 3 weeks ago - 2 months 3 weeks ago #10042 by Administrator IV
Replied by Administrator IV on topic Redirect to the detail after form sent
Hello gms,

After submitting the form you can navigate to the form data.
There are 2 different scenarios that are slightly different.

Below are the configuration settings for both scenarios.

- Scenario 1
Configuration for: User can submit any number of forms
Form: Tab Basic: Name = 'redirect-1'
Form: Tab Basic: Maximum one form submission = No
Form: Tab Result: Save Result = Yes
Form: Tab Result: Redirect URL = http://localhost/developj5/index.php/redirect-1-form/redirect-1-data-edit
Form: Tab Dataview in Frontend: Allow Frontend Data View = Yes
Form: Tab Dataview in Frontend: Own Data only = Yes
Form: Tab Dataview in Frontend: Auto Publish Data = Yes
Form: Tab Form Permissions: Registered: Edit own data in Frontend: Allowed
Field: Tab Advanced: Display Data In Frontend: List and Details
Menu: Menu-Type 'Form data with edit link': Alias = 'redirect-1-data-edit'
Menu: Tab Form Data Display Options: Editable Record Sets Only = Yes

- Scenario 2
Configuration for: User can submit a maximum of 1 form
Form: Tab Basic: Name = 'redirect-2'
Form: Tab Basic:
Form: Tab Basic: Maximum one form submission = Yes
Form: Tab Basic: Action instead of Form: Tab: Selected option 'Redirect to edit view'
Form: Tab Result: Save Result = Yes
Form: Tab Result: Redirect URL = http://localhost/developj5/index.php/redirect-2-form
Form: Tab Dataview in Frontend: Allow Frontend Data View = Yes
Form: Tab Dataview in Frontend: Own Data only = Yes
Form: Tab Dataview in Frontend: Auto Publish Data = Yes
Form: Tab Form Permissions: Registered: Edit own data in Frontend: Allowed
Field: Tab Advanced: Display Data In Frontend: List and Details

Below is the sequence of presentation for the user for both scenarios.

- Scenario 1
Fresh form:
vi-solutions.de/forum-uploads/redirect-f...data_form-1_form.png
List of user records with edit link:
vi-solutions.de/forum-uploads/redirect-f...1_form-submitted.png
Editing the data set:
vi-solutions.de/forum-uploads/redirect-f...mitted_edit-view.png

- Scenario 2
Fresh form:
vi-solutions.de/forum-uploads/redirect-f...data_form-2_form.png
Editing the data set:
vi-solutions.de/forum-uploads/redirect-f...2_form-submitted.png

For scenario 1, an intermediate step is required because there are several data records per user for the form.
It is not possible to simply display the one record for the last form submission.

For scenario 2 it is of course also possible to forward
- only to the short data list (with exactly 1 data record) with edit link
- and not immediately to editing the data record.

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Last edit: 2 months 3 weeks ago by Administrator IV.

More
2 months 3 weeks ago #10043 by qms
Replied by qms on topic Redirect to the detail after form sent
actually i was thinking of something more simple
lets say this is the url for a particular record
index.php?option=com_visforms&view=visformsdata&layout=detailitem&id=1&cid=2
where cid=2 is the auto increment value from that form table
is there a way to insert that cid as variable so that when form is submitted i can recall the new id value from database and put it on url redirect

More
2 months 3 weeks ago - 2 months 3 weeks ago #10054 by Administrator IV
Replied by Administrator IV on topic Redirect to the detail after form sent
Hello gms,

Unfortunately, this option is not available in Visforms as a simple configuration.
One option for developers is to create a custom plugin.

The documentation describes how to create a 'Visforms Custom Plugin'.
Custom Plugin Creation:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/
Custom Plugin Event System:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/
There is a complete custom plugin with all events and help functions as a template that comes with the installation of Visforms:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/

The developer can then decide for himself what else should happen.
Creating a custom plugin requires some PHP development experience on Joomla.

If you need help developing the plugin, we can help you with that - even with the complete implementation.
Please understand that we have to calculate this effort at our current hourly rate of 75 euros plus VAT and at least 1 hour.

In your case you have to use the Visforms event 'onVisformsBeforeSuccessAction'.
There you put your redirect URL in the form object element '$visform->redirecturl'.
You can access all data (current form data as well as all data from the database) and set the redirect URL as desired.

If the Visforms plugin 'Custom Redirects' is activated, you have to be careful.
You have to make sure that it is called before the custom plugin.
You do this by sorting the plugins in the Joomla administration.

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Last edit: 2 months 3 weeks ago by Administrator IV.

More
2 months 3 weeks ago - 2 months 2 weeks ago #10061 by qms
Replied by qms on topic Redirect to the detail after form sent
yes this is exactly what i'm looking for
currently i am fiddling with visform default installation on test server

thanks for direction

Cheers
edit: i found new approach by playing with database
 
Last edit: 2 months 2 weeks ago by qms. Reason: new idea

More
2 months 2 weeks ago #10084 by qms
Replied by qms on topic Redirect to the detail after form sent
For those who wants to achieve similar result
this is what i did without touching custom plugin or database, just using normal subs feature
First you need an additional field either radio or select sql ( i prefer radio)
then add query to get MAX 'id' value from database and increment it by 1
then you can use it as url paramater with custom name cid

this is not optimal solution but enough for me as of now
Next step is to auto select the radio value (is that possible?)
and hide it so that user won't need to see it


Cheers

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum