What are Form Scripts?
Form Scripts are short pieces of code that you can incorporate into your forms to make them do things that are outside the built-in functionality of our form designer.
Our platform uses the well recognised and very powerful scripting language of JavaScript, together with the jQuery framework. This is a very well known language, and there is plenty of material on the internet about using this language. Complete web applications are built on JavaScript. You can pretty much make your forms do anything.
Why would you need to use Form Scripts?
One of the fundamental objectives of SYNTAQ is to make it easy for anyone to design sophisticated Forms, and to use those Forms to automate sophisticated document Templates – without significant coding or IT support. Ideally there would be no need to use Scripts. However, there are some things that we have not implemented within the built-in functionality of the platform, or which are particularly tailored to a specific user requirement.
We have therefore built in the Script Editors to enable you to bridge these gaps. We have been releasing a steady stream of updates to the platform to do away with the need for Script. This will continue as the platform evolves.
How do I find the Script Editors?
You can access the main Form Script Editor from the form builder, under the logic dropdown menu at the top of the page. Here you can set functions to trigger on field change, set values based on complex conditions, build lists, count instances and more!
You can also enter script into various places in a specific field's properties menu. Mostly limited to the logic tab, these script editors will only accept pure JavaScript and have their own custom objects such as data and row, and custom variables such as value and result to make the scripting easier.
Comments in scripts
When we describe what a script is doing we use “//” to denote that the contents after these forward slashes is a comment, and not code. We can also enclose comments between a "/*" and a "*/" to comment out a string of characters withing a line, or over multiple lines.
Ending lines of scripts with a semicolon
You should include a “;” (semicolon) at the end of each line of code.
Resources
You can find some general resources on JavaScript and jQuery here:
Shortcuts for script editor
https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts
Syntax
http://www.csharp-examples.net/dataview-rowfilter/
Comments
0 comments
Article is closed for comments.