Page 1 of 1

Dynamic Forms On Load

Posted: 13 May 2013
by Lucidica - Jamal
I have just been testing with dynamic forms, particularly the 'hide tabs' feature as mentioned in this article

http://spform.com/forms-designer- ... point-2010

The tabs only seem to hide though when the field is changed, how would you get it to hide the tab 'onload' and only show it when the field was changed?

Re: Dynamic Forms On Load

Posted: 15 May 2013
by Dmitry Kozlov
In the example above we call 'setResolutionTab' function that shows/hides tab based on Status field value twice: when Status changes and when page is loaded:

// Subscribe on status change
fd.field('Status').control().change(function () {
setResolutionTab();
});

// Initialize
setResolutionTab();
So, if you wish to hide tab 'onload' without checking the current field value, just call:

$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);
instead of the second call of setResolutionTab after 'Initialize' comment.

Re: Dynamic Forms On Load

Posted: 15 May 2013
by Lucidica - Jamal
the function 'setResolutionTab' works fine on the edit form and the new form but not on the display form

If I put in the line you suggested this works fine on the display form (though obviously it disables the tab in all instances)

From what I can see the setResolutionTab function is not being called on load? Maybe I am missing something?

Re: Dynamic Forms On Load

Posted: 15 May 2013
by Dmitry Kozlov
SetResoultionTab doesn't work on the display form because it's impossible to get Status field value and compare it with specific values. To make different display forms you don't have to use javascript. Use javascript only if you wish to make the form dynamic, change it while user edits fields. If you wish to design a specific form for specific field values and these values will not be changed on this form you have to use groups:
http://spform.com/documentation/groups

With help of groups you can design completely different forms with their specific fields and tabs for the same list and show them in accordance with rules. Rules are built on current field values, current user or date. For display form you have to use rules because values on display form cannot be changed. Please, see our video:
http://www.youtube.com/watch?v=bI7TFO_bN6c&hd=1