Hi,
I'm looking for a smiliar function like nuReturnNewRecord but to redirect the user to another form, not the same one.
The user would
1. Open Edit Form -> 2. Save -> 3. After Save Event ->
Call a function like nuForm($form_id, "", '', '', '1'); in PHP to open the browse screen with the $form_id.
Thanks for all your ideas.
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Redirect to another form after saving
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: Redirect to another form after saving
maybe try following
>>> hide standard save button
>>> add your save button
>>> modify form id acc. to your form (and you can paste directly the code belowe)
just a basic idea - you probably will need to add some other options like changing color to red, etc.
>>> hide standard save button
>>> add your save button
>>> modify form id acc. to your form (and you can paste directly the code belowe)
Code: Select all
function save_AND_go() {nuSaveAction(); setTimeout(function(){nuForm("5cd8079cc7615a0",'','', ''); }, 1000); }
nuHide('nuSaveButton');
nuAddActionButton('my_save_button', 'Save', 'save_AND_go()');
If you like nuBuilder, please leave a review on SourceForge
-
- Posts: 92
- Joined: Mon May 14, 2018 3:26 pm
Re: Redirect to another form after saving
This code poses various problems:
If someone uses the options menu or the shortcut key to save
If the is a "no blanks" validation, the redirection takes place but the form entries are not saved
If a nuBeforeSave function is used and return false is set there
The best (?) way to do this would really be to have a PHP function for it.
If someone uses the options menu or the shortcut key to save
If the is a "no blanks" validation, the redirection takes place but the form entries are not saved
If a nuBeforeSave function is used and return false is set there
The best (?) way to do this would really be to have a PHP function for it.
Re: Redirect to another form after saving
marc,
You could try this in the Form's Javascript section...
(replace 5d8965c525c4d6f with the Form ID you need)
If the Edit Form is not new (-1) you'll go to a different Browse Form once it is saved.
Steven
You could try this in the Form's Javascript section...
Code: Select all
if(nuFormType() == 'edit' && !nuIsNewRecord()){
nuForm('5d8965c525c4d6f', '');
}
If the Edit Form is not new (-1) you'll go to a different Browse Form once it is saved.
Steven
-
- Posts: 92
- Joined: Mon May 14, 2018 3:26 pm
Re: Redirect to another form after saving
This now prevents me from reopening the record at all.admin wrote:marc,
If the Edit Form is not new (-1) you'll go to a different Browse Form once it is saved.
1. Open Edit Form -> 2. Save -> 3. After Save Event -> Redirect to another form.
The forwarding should really only happen after saving.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: Redirect to another form after saving
Marc,
Here's a complete example:
https://github.com/smalos/nuBuilder4-Co ... breadcrumb
But as you wrote in another topic, nuHasBeenSaved() returns a wrong result.
And here comes the fix:
https://github.com/smalos/nuBuilder4-Bu ... n_value.md
Here's a complete example:
https://github.com/smalos/nuBuilder4-Co ... breadcrumb
But as you wrote in another topic, nuHasBeenSaved() returns a wrong result.
And here comes the fix:
https://github.com/smalos/nuBuilder4-Bu ... n_value.md