Form
A <form> that tells its fields how to validate, and gives them the errors of the server.
<script>
import Button from '@brumate/ui/Button.brm';
import FieldError from '@brumate/ui/FieldError.brm';
import Form from '@brumate/ui/Form.brm';
import Input from '@brumate/ui/Input.brm';
import Label from '@brumate/ui/Label.brm';
import TextField from '@brumate/ui/TextField.brm';
</script>
<Form class="ui-form" validationErrors=({ email: 'This email has an account' })>
<TextField class="ui-field" name="email" type="email" value="ada@example.com">
<Label>Email</Label>
<Input class="ui-input" />
<FieldError class="ui-error" />
</TextField>
<Button type="submit" class="ui-button">Sign up</Button>
</Form>
validationBehavioris the default of its fields. See Validation.validationErrorsholds errors by the name of a field, such as{ email: 'This email has an account' }. A field shows them until the user edits it.- It takes the attributes of a
<form>, such asaction, so it posts without scripts.