Several Save buttons

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Phoenix
Posts: 23
Joined: Wed Dec 10, 2014

09 Dec 2014

Dear SPForms Team

On my forms I have several Save buttons, such as approve, save (doesn't change status), reject etc. Some fields on the form are not manadatory, if the request gets rejected but if it gets approved some fields have to have some value.


How to I access the different save buttons in javascript. I can't see any ID's.


Thanks for your help

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

10 Dec 2014

Hi,

You should put your code into OnClick property of a particular button in Forms Designer and it will be executed when a user clicks this button.

Phoenix
Posts: 23
Joined: Wed Dec 10, 2014

10 Dec 2014

Ok, thanks, this will work. So it is not possible to add the code for the different buttons in the general javascript?

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

11 Dec 2014

Hi,

You can define a global function in general JavaScript following way:

Code: Select all

window.globalFunction = function() {
// Your code here
}
And call it in OnClick handlers.

Jdubs
Posts: 73
Joined: Fri Dec 19, 2014

15 Jan 2015

Awesome. Perfect explanation!


Thank ya sir

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests