contains rule (v1)
Require the input to contain a given string.
Usage
bootstrapValidate('#input', 'contains:something:Your text needs to contain something!')Options
| Name | Description | Example |
|---|---|---|
string | string: String to appear in the Input Element | something |
Live Example
Checking...
Source
/** * @since 1.0.11 * @param string string: String to appear in the Input Element * @description Require the input to contain a given string. * @example something * @error Your text needs to contain something! */export default function contains(input: RuleInput, string: RuleOption) { return input.value.includes(String(string));}