Not applicable

How to call javascript function on Save button click?

Jump to solution

Hi All,

I want to call javascript function on save button click in nintex form.

Fo this in control setting of the button i do cause validatio true and give client call function name.

 

But the function doesnt fire when we hit the button?

Any example which demonstrate this as i want to do some validation on save button click?

 

 

 

 

Thanks..

Arvind

Tags (1)
Reply
7 Replies
christopheraucq
Automation Master
Automation Master

Re: How to call javascript function on Save button click?

Jump to solution

Hi Arvind,

Can you try to add this code in the Settings of the Save button under Advanced section in Client Click

NWF$(document).ready(function(){alert('Save Clicked');});

Regards,

Christophe

View solution in original post

0 Kudos
Reply
Not applicable

Re: How to call javascript function on Save button click?

Jump to solution

Hi All,

Thanks Christrophe!!

I tried the above solution it works. Now   i am trying to call a function from the save button settings under Advanced Section in client click.

NWF$(document).ready(function(){validateMandatory();});

It is working. But if if try to return false if validation false. then it does.not work?

Please let me know where i am making mistake ..!!!:)

Below is the Code sample.

function ValidateMandatory()
{


var Name=NWF$("#"+varName);
var Reason=NWF$("#"+varReason);
var namevalue=Name.val();
if(namevalue=="")
{
    return false;
}


}

Thanks

Arvind

0 Kudos
Reply
Not applicable

Re: How to call javascript function on Save button click?

Jump to solution

Hi Arvind,

I'm facing the same problem i when i try to return false the form is submitted. how could u solve this issue ?

Thanks,

Muhammad

0 Kudos
Reply
Not applicable

Re: How to call javascript function on Save button click?

Jump to solution

Hi Muhammad,

Please write below line in  save button settings under Advanced Section on  client click.

if( ValidateMandatory() == true) { return true; }  else { return false; }

Regards,

Arvind

Reply
kmorry19
Nintex Newbie

Re: How to call javascript function on Save button click?

Jump to solution

Hey Christophe,

I've also tried this. Can you please help me implement this code when also running and if() statement on multiple fields in the nintex form?

I need the confirm window to appear when multiple fields have certain values.

Thanks!

Kimberley

0 Kudos
Reply
christopheraucq
Automation Master
Automation Master

Re: How to call javascript function on Save button click?

Jump to solution

Hey Kimberley,

This Update fields before Submittinghould helps you.

And also that one Update fields before Submitting (Part 2)

Regards

Christophe

0 Kudos
Reply
christopheraucq
Automation Master
Automation Master

Re: How to call javascript function on Save button click?

Jump to solution

Hi Kimberley Morrison

This must help you

if(NWF$('#' + intLotNumber).val() == 1000) { alert('Yes') }

Please be aware that I have renamed your Javascript variable to intLotNumber

Regards,

Christophe

Reply