Mandatory Related Item

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
enillrae
Posts: 17
Joined: Mon May 29, 2017

29 May 2017

Hello,

I currently have a form in which has two sets of related items in quick edit mode. Is it possible to make it mandatory? I

Thank you

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

30 May 2017

Hi,
Please, read the thread:
viewtopic.php?f=1&t=633

enillrae
Posts: 17
Joined: Mon May 29, 2017

02 Jun 2017

Hi Dmitry,

I'm sorry I'm new to javascript.

can you explain how it would work in the "on submit". My related item is on another tab. When I added the code you suggested, the tabs are not displayed correctly to the top.

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

05 Jun 2017

Hi,
Do you mean that you want to activate a tab containing the Related Items control if a user left it empty? Then, please, use the code below:

Code: Select all

fd.onsubmit(function() {
    if (fd.relatedItems(0).data('ctx').ListData.Row.length == 0) {
        alert('Please, add related items');
        fd.tabControl(0).tabs('option', 'active', 1);
        return false;
    }
    
    return true;
})
Replace (1) in the line: fd.tabControl(0).tabs('option', 'active', 1); with 0-based index of the tab containing the related items.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests