words()
Ensure the input contains a specific range of words.
Setup
<!-- Form Container -->
<div sf="myForm">
<form>
<!-- Textarea with Words Validation -->
<div sf-step="step1">
<label for="inputText">Enter your text:</label>
<textarea name="inputText" id="inputText" sf-validation="words(0,3)" required></textarea>
<div class="text-style-error">Text must be a maximum of 3 words.</div>
<button sf-goto="next">Next</button>
</div>
</form>
</div>
sf-validation = words(0,3) to a <textarea> element.Usage Examples
Attribute Configuration
Last updated