Several Save buttons
Posted by Phoenix - Dec 9 ’14 at 12:13
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
-
Dmitry KozlovAdminMember for: 8 years 9 months 7 days
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.
-
PhoenixMemberMember for: 7 years 6 months 20 days
[#1]: Ok, thanks, this will work. So it is not possible to add the code for the different buttons in the general javascript?
-
Dmitry KozlovAdminMember for: 8 years 9 months 7 days
[#2]: Hi,
You can define a global function in general JavaScript following way:
window.globalFunction = function() { // Your code here }
And call it in OnClick handlers.
-
JdubsMemberMember for: 7 years 6 months 10 days