Skip to content

useFormValidation

Import

import { mix, useFormValidation, BoltElement } from 'c/bolt';

Usage

export default class myLwc extends mix(
[useFormValidation],
BoltElement
) { }

Attributes

formValidity : boolean

Example

async updateRecord() {
if(this.formValidity)
await this.saveRecord(this.Case);
}
<template>
<c-bolt-input lwc:spread={$Case.Status} />
<lightning-button onclick={updateRecord} />
</template>

isFormValid : boolean

Example

async updateRecord() {
if(this.isFormValid)
await this.saveRecord(this.Case);
}
<template>
<lightning-input data-checkable value={Case.Contact} />
<lightning-button onclick={updateRecord} />
</template>