cancel
Showing results for 
Search instead for 
Did you mean: 

Form submit redirection

guiguik
Champ in-the-making
Champ in-the-making
Hi guys,

I am facing a little solution and I'm sure you could help me.

I have a specific type of content in my site that I can create. I have a button from my doclibrary to open the create-content form with the type as a parameter in the url.
What I want to do is when I click on create in the create-content form for this specific type, I want to go back to the document-library with for example
history.go(-1);
instead of going on the content detail.

Is there a specific configuration, in the form-config for example, or does I need to overide the create-content action? And in that case, in wich file could I find the submit action?

Thanks in advance
2 REPLIES 2

rjohnson
Star Contributor
Star Contributor
This is oddly quite hard to achieve because it is buried in the forms runtime which is a complicated script.

It can be done. You need to write some JS that gets loaded into the form and executes at document ready that finds the instance of the forms runtime (standard Alfresco object finder call) and then you can interfere with the objects properties / methods. One of which is "where do I go next".

guiguik
Champ in-the-making
Champ in-the-making
Hi rjohnson,

Is there any other way to do it easily?
In the form documentation: https://wiki.alfresco.com/wiki/Forms_Developer_Guide, I was that there is a redirect proprerty. Is it not possible to use this way to perform my redirection?

In other case, I think that I have to make some change like in this post: https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/redirect-formprocessor-post-we... or is it more complex?