Several Save buttons

rss

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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #1 by Dmitry Kozlov Dec 10 ’14 at 04:10

    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
    Member
    Member for: 5 years
    #2 by Phoenix Dec 10 ’14 at 04:35

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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #3 by Dmitry Kozlov Dec 11 ’14 at 06:13

    [#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.

  • Jdubs
    Member
    Member for: 4 years 11 months 21 days
    #4 by Jdubs Jan 15 ’15 at 09:26

    [#3]: Awesome.  Perfect explanation!

     

    Thank ya sir!

Displaying 1 to 4 of 4 messages