Page 1 of 1

Several Save buttons

Posted: 09 Dec 2014
by Phoenix
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

Re: Several Save buttons

Posted: 10 Dec 2014
by Dmitry Kozlov
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.

Re: Several Save buttons

Posted: 10 Dec 2014
by Phoenix
Ok, thanks, this will work. So it is not possible to add the code for the different buttons in the general javascript?

Re: Several Save buttons

Posted: 11 Dec 2014
by Dmitry Kozlov
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.

Re: Several Save buttons

Posted: 15 Jan 2015
by Jdubs
Awesome. Perfect explanation!


Thank ya sir