Save without closing

rss

Posted by Sonoma - Nov 24 ’15 at 03:26

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.






  • rostislav
    rostislav
    Moderator
    Member for: 6 years 6 months 25 days
    #1 by rostislav Nov 25 ’15 at 07:12

    If you only want it for the edit form:

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

    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
    Member
    Member for: 7 years 2 months 5 days
    #2 by Sonoma Nov 25 ’15 at 09:13

    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
    Member
    Member for: 7 years 2 months 5 days
    #3 by Sonoma Nov 25 ’15 at 09:28

    [#2]: 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
    Member
    Member for: 7 years 2 months 5 days
    #4 by Sonoma Nov 25 ’15 at 09:50

    [#3]: Clarification-The hotfix fixed the issue microsoft had not this problem with saving. Thank you.

  • rostislav
    rostislav
    Moderator
    Member for: 6 years 6 months 25 days
    #5 by rostislav Nov 25 ’15 at 10:34

    [#4]:

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

  • Sonoma
    Member
    Member for: 7 years 2 months 5 days
    #6 by Sonoma Nov 25 ’15 at 10:44

    [#5]: 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
    Member
    Member for: 7 years 2 months 5 days
    #7 by Sonoma Nov 25 ’15 at 11:00

    [#6]: 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.

     

     

Displaying 1 to 7 of 7 messages