Dynamic Forms On Load

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
Lucidica - Jamal
Posts: 7
Joined: Mon May 13, 2013

13 May 2013

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

15 May 2013

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.

User avatar
Lucidica - Jamal
Posts: 7
Joined: Mon May 13, 2013

15 May 2013

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

15 May 2013

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests