Set a value by Save and Continue button with Javascript

  • 11 June 2019
  • 1 reply
  • 61 views

Badge +1

I want to set a value to a control by clicking Save and Continue button with Javascript. However the field of client click isn't appeared for the Save and Continue button. So I did below.

1. Put a button control and change the button action as "Save and Continue" and give it the class as "mySaveAndContinueButtonClass".

2. Put another button control and change the button action as "Javascript" and put below code in the client click field. 

NWF$('#' + CID_Title).val("My value");
$("input.mySaveAndContinueButtonClass").click(function());

After the form published it seems the "Save and Contiune" button is clicked by clicking "Javascript" button but saving doesn't happen.

What is worng? Or do you have alternative solution for this?

 

I know that a value can be set to a control by setting "Connected to " but I need to do it by Javascript.


1 reply

Userlevel 2
Badge +11

When setting a value on a form field add a .focusout() behind the val(). This will work like pressing enter or tab in the form and 'commits' the set value.

Reply