Catalog client script examples

Examples of client scripts to perform common actions.

Get the value of a variable

Use the following syntax to obtain the value of a catalog variable. Note that the variable must have a name. Replace variable_name with the name of the variable.

g_form.getValue('variable_name');

Restrict the number of characters a user can type in a variable

This is an example of a script that runs when the variable is displayed, rather than when the item is ordered.

functiononLoad()
          {var sd = g_form.getControl('short_description');
          sd.maxLength=80;
       }