July 13, 2017 at 08:58 #17259
I have these buttons in EditForm:
<input id="btnAction1" class="customBtn" type="button" value="ACTION1" onclick="fnAction1();return false;"> <input id="btnAction2" class="customBtn" type="button" value="ACTION2" onclick="fnAction2();return false;"> <input id="btnAction3" class="customBtn" type="button" value="ACTION3" onclick="fnAction3();return false;"> <input id="btnAction4" class="customBtn" type="button" value="ACTION4" onclick="fnAction4();return false;">
each button fill different values to form and call submit.
Is it possible redirect user to different locations (different views) after submitting depending on which button was use?
Is it possible to change Source= parameter in url?
I tried to add this line
it is working, but when there is some error in form at submitting (eg missing required field) – form is redirected immediatelly without possibility to correct form.
July 18, 2017 at 10:08 #17327
You can use this snippet in each of your functions:
Let me know how it works out.
July 24, 2017 at 22:50 #17418
it is not working – no redirection is done.
July 25, 2017 at 09:15 #17437
This should work by setting the redirect-on-save to the new URL, but the actual redirect will only happen when the form is actually saved (using the default button).
If you like your custom button to set the redirect URL and save the form you need to add one line to your function to “click” the default save button.
I’ll have to see your current code to see how you “submit” the form to be able to help you further because my code example only works with the default save button and not with any custom submit function.
You must be logged in to reply to this topic.