sets values for all inputs in the component
values | object | hash of property - value pairs |
update | boolean | if true adds updates the form with new values while exisitng values remain. **False by default** |
function set_form(){
$$('myform').setValues({
field_a: "London",
field_b: "New York"
});
};
The methods allows for setting several values at at time. Pass the IDs of the necessary form elements and their values into the function.
The second parameter helps manipulate values set separately. By delaut, it is false.
Take that we set new value for a field_b input from the form described above.
$$('my_form').setValues({ field_b:"Paris" });
In this case, the value for the field_a is lost. To avoid this, set the update parameter to true. The form will be updated with a new value for field_b input while field_a value remains unchanged.
$$('my_form').setValues({ field_b:"Paris" }, true);
Back to top