show / hide menu

InvokeJavaScript ()

This function is available in the ClaySys AppForms which enables the user to execute the JavaScript functions available in the ClaySys AppForms.

1 . SYNTAX:

  • Arguments:

➣ ScriptFunctionName: Name of the JavaScript function.
➣ Parameters: This is optional. The Parameters to the JavaScript function can be ‘n’ numbers separated by a comma.

2 . Example to implement the function InvokeJavaScript() without a parameter.

  • Create a form in ClaySys AppForms with a button as shown below where the function InvokeJavaScript() has to be executed on a button click.
  • Create a new rule from the ‘Rules Panel’ with the button as a trigger.

➣ Add an action to the newly created rule by clicking on button .

➣ Now an’ Expression Builder ‘ gets open up.

  • Select the group ‘Functions’ from the first section.
  • Select the group as ‘Script Operations’ from the listed group of functions.
  • Select the script operation as ‘InvokeJavaScript’ from the listed script functions and click on button.
  • The selected function gets added up to the ‘Selected Expression’ field.
  • Now the name of the JavaScript function has to be mention within braces which is mandatory.

➣ Here the function Resolution() is defined as below:

function Resolution()
{
var width = window.screen.width;
alert(width);
}

  • Now click on button ‘Verify’ to verify the selected expression .
  • The selected expression gets added as a new action for the rule upon clicking on button ‘Done’.
  • In Preview ,

➣ The executed result of the JavaScript Function will be shown in the preview on the button click.

1 . Example to implement the function Invoke JavaScript() with parameters.

  • Create a form in ClaySys AppForms with a button as shown below where the function InvokeJavaScript() has to be executed on a button click.
  • Create a new rule from the ‘Rules Panel’ with the button as a trigger.

➣ Add an action to the newly created rule by clicking on button.

➣ Now an’ Expression Builder ‘ gets open up.

  • Select the group ‘Functions’ from the first section.
  • select the group as ‘Script Operations’ from the listed group of functions.
  • Select the script operation as ‘InvokeJavaScript’ from the listed script functions and click on button.
  • The selected function gets added up to the ‘Selected Expression’ field.
  • Now the name of the JavaScript function has to be mention as the first parameter which is mandatory.

➣ Here the function foo() is defined as below:
function foo(value)
{
alert(value);
}

  • The values that has to be passed to the JavaScript function needs to be entered as the parameters in the function ‘InvokeJavaScript()’ separated with a comma. This is optional.
  • Now click on button ‘Verify’ to verify the selected expression .
  • The selected expression gets added as a new action for the rule upon clicking on button ‘Done’.
  • In Preview ,

➣ The executed result of the JavaScript Function will be shown in the preview on the button click.