What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Vue 3, bind form controls to reactive state with v-model, run explicit validation rules, and prevent submission until the form passes them. For a small form, plain Vue functions are enough; for larger or nested forms, choose a validation library such as vee-validate or Vuelidate. In every case, keep server-side validation authoritative and show accessible, field-specific feedback.

Start with a semantic form and reactive values

v-model synchronizes form controls with Vue state, but it does not decide whether a value is acceptable. The Vue forms guide describes it as a way to simplify manual value bindings and input listeners. Text inputs and textareas synchronize through value and input; checkboxes and radios use checked and change; selects use value and change. Modifiers adjust that synchronization: .lazy waits for change rather than input, .number attempts numeric casting, and .trim removes surrounding whitespace. None of these replaces required, format, cross-field, or server validation.

Use a real <form> and submit handler, and connect each label to its control with matching for and id attributes. Vue’s accessibility guidance recommends semantic form elements such as <form>, <label>, <input>, <textarea>, and <button>.

Validate a small Vue form without a library

This Vue 3 component validates a required email and a password of at least eight characters. It shows a field error after blur or the first submit attempt, blocks invalid submission, and places an error summary in an announced region. Replace the placeholder submit action with your API call.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
<script setup>
import { computed, reactive, ref } from 'vue'

const values = reactive({ email: '', password: '' })
const touched = reactive({ email: false, password: false })
const submitted = ref(false)
const status = ref('')

const errors = computed(() => ({
  email: !values.email.trim()
    ? 'Enter your email address.'
    : /^[^s@]+@[^s@]+.[^s@]+$/.test(values.email.trim())
      ? ''
      : 'Enter an email address in the format name@example.com.',
  password: values.password.length >= 8
    ? ''
    : 'Use at least 8 characters for your password.'
}))

const visibleError = (field) =>
  (touched[field] || submitted.value) ? errors.value[field] : ''

const isValid = computed(() =>
  Object.values(errors.value).every((message) => !message)
)

async function submit() {
  submitted.value = true
  status.value = ''
  if (!isValid.value) return

  // Send values to your server here; validate them there as well.
  status.value = 'The form passed client-side validation.'
}
</script>

<template>
  <form novalidate @submit.prevent="submit">
    <div>
      <label for="email">Email</label>
      <input
        id="email"
        v-model.trim="values.email"
        type="email"
        autocomplete="email"
        :aria-invalid="Boolean(visibleError('email'))"
        :aria-describedby="visibleError('email') ? 'email-error' : undefined"
        @blur="touched.email = true"
      >
      <p v-if="visibleError('email')" id="email-error">
        {{ visibleError('email') }}
      </p>
    </div>

    <div>
      <label for="password">Password</label>
      <input
        id="password"
        v-model="values.password"
        type="password"
        autocomplete="new-password"
        :aria-invalid="Boolean(visibleError('password'))"
        :aria-describedby="visibleError('password') ? 'password-error' : undefined"
        @blur="touched.password = true"
      >
      <p v-if="visibleError('password')" id="password-error">
        {{ visibleError('password') }}
      </p>
    </div>

    <p v-if="submitted && !isValid" role="alert">
      Fix the errors above before submitting.
    </p>
    <p role="status">{{ status }}</p>
    <button type="submit">Create account</button>
  </form>
</template>

The email expression here is a practical client-side format check, not a definitive test that an address exists or can receive mail. Likewise, the password rule is an example policy, not a universal security standard. Define rules from the needs of your product and enforce important constraints on the server.

Choose when errors appear

  • On blur: the example marks a field touched when a visitor leaves it, so a pristine form does not start with errors.
  • After the first submit: submitted exposes all remaining errors, including fields the visitor has not visited.
  • On input: you can also validate as values change, but avoid making an error flash while someone is still typing. A common compromise is to show it after first blur and then update it as the user edits.

For a long form, add an error summary with links to invalid controls and move focus to the first invalid control after an unsuccessful submit. Keep each field’s error adjacent to its control and associate it using aria-describedby, as in the example. A visual error alone is not enough for people using assistive technology.

Choose between hand-written rules, Vuelidate, and vee-validate

Approach Rule style and form shape Useful when Trade-off
Plain Vue Functions over reactive values; you decide how to organize nested data. The form is small and its rules are straightforward. You must implement error timing, touched state, pending state, reset, and submit behavior yourself.
Vuelidate Next Model-centric validation tree that follows reactive state. Rules naturally mirror a domain model, especially nested models or collections, and custom predicates are important. You shape the rules and validation tree around your model rather than using a field/form schema-first workflow.
vee-validate v4 Field and form primitives, or template components, with optional form-level schemas. You want explicit field/form state, controlled submit and reset behavior, async rules, reusable schemas, or custom component integration. It introduces library concepts and dependencies that may be unnecessary for a tiny form.

Use Vuelidate for model-shaped validation

Vuelidate documents a lightweight, model-based and decoupled approach. Its Vue 3 path is Vuelidate Next, commonly used with Composition API and useVuelidate(). A rule object can use validators such as required and email. It also supports nested models, collection validations, contextual validators, composition, and custom predicates. Consider it when the validation structure should track a complex reactive model rather than a set of independently configured fields.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Use vee-validate for field and schema workflows

vee-validate v4 is built around Vue 3 Composition API primitives including useForm and useField; its Form, Field, and ErrorMessage components offer a template-oriented alternative. Its documentation says it supports synchronous and asynchronous validation, with rules defined at field level or through form-level schemas. It also supports custom components through its composition functions.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose vee-validate when you want explicit valid, dirty, touched, or pending state, reusable schemas, or built-in submit/reset flow. For example, its Yup integration can express a required email with yup.string().required().email() and a password minimum. The docs also describe Zod and Valibot integrations. Do not recreate a large schema on every render unless its rules genuinely depend on reactive values.

Stop invalid submissions and handle server errors

In hand-written Vue code, run the complete check inside the submit handler rather than relying on a disabled button or on validation that ran earlier. Values can change between an earlier check and submission. The native example does this by setting submitted, checking isValid, and returning before the submit action.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

vee-validate validates before calling the valid submit handler. Its submission guide says that, in most cases, fields should be valid before submission and that this is done by default. Use handleSubmit for JavaScript or AJAX submission, submitForm when you need native form submission while blocking invalid data, and validate when you want to run checks without submitting. Its documented flow also covers invalid-submit handling, touched and pending states, submit counts, and reset APIs.

  1. Initialize values and define field or schema rules.
  2. Choose whether each field validates on blur, input, or submit; use async validation only where a remote check is necessary.
  3. On submit, validate the whole form and expose errors for fields that have not yet been touched.
  4. When invalid, focus or announce the first problem and give a clear route to the affected field.
  5. When valid, submit to the server. Map server-returned field errors back to the matching controls and show non-field errors in an announced summary.
  6. After success, reset values and validation state only if that matches the flow—for example, do not erase a form when the user needs to correct a separate server-side problem.

An async client check can improve feedback, but it cannot make a uniqueness, authorization, or security decision trustworthy. A request may be stale, the network may fail, or another user may change the underlying data before submission. The server must validate the submitted values and return an error the interface can explain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use schemas and types where they reduce duplication

For a larger form, keep a Yup, Zod, or Valibot schema close to the form boundary and reuse the same rules where appropriate. vee-validate provides typed schema adapters such as @vee-validate/yup and @vee-validate/zod; its toTypedSchema adapter lets the library infer input and output types from schemas. That can help distinguish values as entered from parsed or transformed values. It does not make the browser’s data authoritative: the server still needs its own checks.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Do not make one giant schema for unrelated forms simply to avoid writing field rules. A schema is most helpful when it is a coherent contract for a form, can be reused, or captures relationships among fields. Cross-field rules—for example, requiring a confirmation field to match a password—should be rerun when either related value changes, not only when the dependent field is first blurred.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test validation behavior, not just rule functions

For each form, check the interaction as well as the predicates. At minimum, verify that a blank submit is blocked, a valid submit reaches the handler, blur and submit reveal errors at the intended time, and correcting a value clears its message. Also cover reset, async waiting and failure states, server field errors, keyboard navigation, and screen-reader association between labels, controls, and messages.

Test boundary values such as whitespace-only input, the shortest permitted value, a value just below the minimum, and changes to one side of a cross-field rule. If you use .number, check the actual value type your handler receives; a binding modifier is a synchronization convenience, not a substitute for validating the accepted range or handling an empty value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Troubleshoot common Vue validation failures

  • The form submits even though an error is visible: make the submit handler run the full current validation and return early on failure. Do not treat an error’s presence in the DOM or a disabled button as the enforcement mechanism.
  • No error appears until too late: decide explicitly whether the field becomes touched on blur and whether the first submit reveals all errors. Check that the rendered error uses the same state and rule result as the submit handler.
  • Errors stay after the value is fixed: ensure validation recomputes when the relevant value changes. For a cross-field constraint, changes to either participating field should trigger a new check.
  • A remote check flickers or returns an old result: represent a pending state, avoid sending a request on every keystroke without a suitable delay, and prevent stale responses from replacing results for newer values. The final submit still needs server validation.
  • Assistive technology does not identify the error: give the control a stable id, point the label’s for to it, and connect the error with aria-describedby. Announce form-level feedback when appropriate rather than relying on color alone.
  • Nested or repeated fields become hard to maintain: choose a model-oriented validation tree or a field/form library that suits the actual data shape instead of copying predicates into many templates.
  • Code written for an older Vue setup does not match current guidance: use Vue 3 as the baseline. Vue 2 support ended on December 31, 2023; Vuelidate’s Vue 3 path is Vuelidate Next, and the examples and library choices here are for Vue 3.

Or skip the browser setup

Form validation belongs in your Vue application and on your server; a screenshot API does not replace either. If you also need a screenshot of the page for a visual check, ScreenshotNeo can capture a URL with one GET request. The example below uses its documented endpoint; see the ScreenshotNeo API docs for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie and consent banners are accepted before capture, and 60+ known consent platforms, newsletter popups, and chat widgets are removed; each step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers report the page verdict and whether it was billed.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Frequently Asked Questions

Can I use native HTML validation alongside Vue validation?

Yes. Decide deliberately whether browser-native validation or your Vue interface owns the feedback flow; mixing both can produce duplicate or inconsistent messages. The native Vue example uses novalidate so its own messages control that flow.

Does validating on the client make a form secure?

No. Client checks improve usability, but users can bypass them or alter requests. Enforce permissions and business rules on the server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.