Save without closing

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

24 Nov 2015

Version 3.0.5.



I am working with tabs and next button. The next button takes me to the next tab fine.

I would like to save the form without closing but it can't seem to get it to work.



I added a button to call the next tab and add this to the click

fd.sourceFormParam(window.location.href);
return true;

It does not work.
However fd.save().click(); does work but it closes the form.

My code to get next tab:
$("#fd_tabcontrol-0").tabs();
$(".nexttab").click(function() {
var active = $( "#fd_tabcontrol-0" ).tabs( "option", "active" );

//Attempt 1
//fd.save().click();

//Attempt 2
//fd.sourceFormParam(decodeURIComponent(window.location.href));
// return true;

//Attempt 3
//var uri = fd.setUrlParam(decodeURIComponent(window.location.href), 'FDRedirectWithID', 'fd_Item_Edit.aspx?ID=');
// fd.sourceFormParam(uri);
//return true;

$( "#fd_tabcontrol-0" ).tabs( "option", "active", active + 1 );
//return true;
});


I have commented out my what does not work. I have tried to add a button called "save without closing" with the code
fd.sourceFormParam(window.location.href);
return true;

added to the click method. It did not save.

Any thoughts?

I need to save when going to the next tab.

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

25 Nov 2015

If you only want it for the edit form:

Have this code inside the onclick property of the "save & move forward" button:

Code: Select all

var active = $( "#fd_tabcontrol-0" ).tabs( "option", "active" );

$.cookie("fd_tabcontrol-0", active+1);

fd.sourceFormParam(window.location.href);

fd.save().click();

Replace "fd_tabcontrol-0" (in two places) for whatever is the id of your tab control.

Tell us if you'll be wanting this for the new form as well

Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

25 Nov 2015

Thank you.

It does save but it seems the fd.save().click(); takes back out to the main list view (Allitems.aspx) instead of the next tab.



As far as the new form goes I can pass for now. I just get the basic information then let the user save and redirect to the edit form. This allows the user to use the related forms with out any issues. Even with 3.0.5 I never quite got the related forms to work properly on the new forms just the edit form.

We typically have 5-10 related forms with in each form. Each form may use 5-20 tabs. It can be a night mare if they think the form is saved and they close it before hitting the save button.


Thank you again.

Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

25 Nov 2015

Not sure if it is relevant but we were having a refresh/redirect issue and applied the >NET framework hotfix located here https://support.microsoft.com/en-us/kb/3062825.

Our issue was related to issue #8. The latest HotFix resolved it.

Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

25 Nov 2015

Clarification-The hotfix fixed the issue microsoft had not this problem with saving. Thank you.

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

25 Nov 2015

Do you have any code in the save button onclick property or inside the fd.onsubmit() handler?

Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

25 Nov 2015

Just this



//fd.onsubmit(function() {

// var uri = fd.setUrlParam(decodeURIComponent(window.location.href), 'FDRedirectWithID', 'fd_Item_Edit.aspx?ID=');

/// fd.sourceFormParam(uri);

// return true;

//});



But it is commented out.

Sonoma
Posts: 88
Joined: Wed Oct 15, 2014

25 Nov 2015

I created a new form from scratch. It worked.
I will investigate code further. Definetly has to be something I have done.

Thank you for the help and the push in the right direction.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests