Support Article
Unable to pass parameter to function from section
SA-8350
Summary
You are trying to pass a parameter to a JavaScript (JS) function from a button control inside section, but the parameter is not updated for the function when the function is called.
Error Messages
"The parameter is not set."
Steps to Reproduce
1. Create a JS function which accepts the parameter
2. Add this script to harness
3. Add a button control in the section and add this section to harness mentioned above
4. In the section use the onclick event and choose action as function
5. Call the parameterized function from the section and pass clipboard property as parameter to function
6. Check by alert or logging if parameter is passed sucessfully or not.
Root Cause
The root cause of this problem is a defect in customer application code/rules. The customer's JavaScript did not include the parameter name as a parameter in the function declaration - just as a local variable, so the variable was not being set.
Resolution
This issue is resolved through the following local change: Add the parameter name to the function declaration and the parameter was passed successfully.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.