Version: v0.7.0 - Beta.  We welcome contributors & feedback.

Form.setValues

$form.setValues($mapOfValues) -> false

Description

Pre-fill values for the given form fields.

This is commonly used when letting the user edit a database record, for instance.

$form = Form.create('contactInfo', {
    email: {
        rule: 'email',
    },
    phone: {
        rule: 'phone',
    },
})

// E.g. from a database row
$user = {
    email: 't.thomson@mail.com',
    phone: '450-123-3333',
}

$form.setValues($user)

See Also