The client-side Glide classes are for use in scripts that are run directly in front of the user. These include manipulating and working with form fields and user data and being able to call server-side scripts to return values in the database.
I would say that GlideForm or g_form
is the most used client-side class. It is mainly used for getting data from the fields on the form and setting values to those fields as well. We can also change elements of those fields using g_form
.
We'll start by looking at how to get and set values from and into fields:
var stateValue = g_form.getValue('state');
The string value inside the speech marks is the database name for the field. Make sure you use the name rather than the label when getting a value using g_form
. The getValue
method essentially puts the value of a field into a variable for you. This then allows you to use that variable to check against other data or pass as a parameter into a function:
g_form.setValue('state...