startsWith rule (v2)
Require the input value to start with a given string.
Usage
bootstrapValidate('#input', 'startsWith:+49:Your phone number needs to start with +49')Options
| Name | Description | Example |
|---|---|---|
string | string: String the input value should start with | +49 |
Live Example
Checking...
Source
/** * @since 1.1.0 * @param string string: String the input value should start with * @example +49 * @error Your phone number needs to start with +49 * @description Require the input value to start with a given string. */export default function startsWithRule(input: RuleInput, string: RuleOption) { return startsWith(input.value, String(string));}