Condition on Next button

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

22 Feb 2017

Hi, I have a Next button which is saving the item while editing (i have actually 6 of them: one on each tab) with this code:

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

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

fd.sourceFormParam(window.location.href);

fd.save().click();

I need to place a condition to each button to check the fields on that particular tab and give people worning like: You haven't populated all the fields, do you want to continue?" so if people click OK - it will save and proceed, if Cancel - stay on the tab.

So i have this condition which works:

if (fd.field('Choice1').value() == "" || fd.field('Choice2').value() == "") {

alert('You haven't populated all the fields, do you want to continue?');

return true;

}



I tryed to put it before fd.save, but nothing is happening.

Is it possible to do?

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

27 Feb 2017

Hi,

Try to return 'false' after alterting.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests