w2form.setValue

Sets a new value of a given field.
setValue(field, value)
field string, name of the field
value any, new value for the field
Returns boolean, true if setting the value was successful, otherwise false.

Description

This method will find the field in the .fields array and set its value to value. If the field does not exists, form.record will be extended with the new field name. The field can be nested, for example "file.name".
Setting a value will not refresh the form.
If you have form defined in the following way: You can do:

User Comments

comments powered by Disqus