Skip to content

Spec Form Api

jdubs edited this page Oct 20, 2016 · 1 revision

Table of Contents

Overview

Four51 has identified many common spec form functionality requests that require extensive JavaScript programming and wrapped them into an easy to use Application Programming Interface. The goal of this API is to provide hooks into methods that are attached to elements on spec forms including spec controls. It is intended for use by skilled developers familiar with JavaScript programming principles. However, it can be utilized by non-developers needing to leverage additional features without the need to write JavaScript code. The API is divided into two distinctive parts: Methods and Widgets. Methods are purely programmatic function calls that are referenced in the JavaScript code. Widgets are add-ins that can be utilized without a programming effort, but do also have events that allow you to hook into their functionality

This guide is intended to show you how to get started with the service and describes the methods and Widgets currently available in the API. Methods and Widgets are frequently added to the library.

  • To access Advanced Scripting, your administration user must be enabled with appropriate permissions. To enable your user, contact Four51.
  • To access the Advanced Scripting interface, do the following.
    • Log on to your Four51 administration interface.
    • Navigate to a variable product.
    • Select the Spec Form link in the left-hand navigation.
    • You should now see a tab named Advanced Scripting. Click this tab to access the interface. Place your JavaScript code here and click Save. Note that the interface provides auto complete features to ease your code development.

Four51 Spec Form API is a collection of JavaScript functions made available to administrator users who have been granted permission to use Advanced Scripting in their product's spec forms. These methods are designed to ease the complexity of JavaScript by identifying common programming tasks specific to spec forms and creating alternative, easy to understand functions. Included in each methods definition are the parameter signatures. Parameters surrounded with [] are considered optional. If not marked optional you should consider required.

Four51 Spec Form Widgets are functional control sets that perform specific actions and do not require JavaScript programming.

Four51 Spec Form Validators are extended validation controls for specific input requirements. Every validators can be defined to fire on one of two events: onblur, onsubmit. Controls for displaying validation errors is built into each validators. The event can be overridden and controlled separately if desired. It is recommended that you do not override onSuccess or onError unless absolutely necessary. All validators have identical options exposed. By default, when validation fails a red exclamation point image is displays with mouse over error message and the control's background property is changed to pink. On success these errors are cleared. When the action is defined as "onBlur" the error is marked next to the control, however the form is still allowed to submit.

Clone this wiki locally