Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
Procesar un formulario HTML sin el botón Enviar usando VeeValidate

Creé un controlador de formulario usando su componible dentro de mi <script setup> :

 const { submitForm, resetForm, handleSubmit, meta } = useForm() function save() { // Here I want to submit the form submitForm() // This doesn't work showSaveSnackbar.value = false } function discard() { resetForm() showSaveSnackbar.value = false } const onSubmit = handleSubmit(values => { // pretty print the values object alert(JSON.stringify(values, null, 2)); });

Y en mi plantilla escribí esto:

 <form @submit="onSubmit"> <!-- inputs --> </form>

Hice una barra de bocadillos con un botón que aparece (usando el atributo meta.dirty de meta.dirty ). Cuando edito el formulario y quiero enviarlo, quiero usar este botón personalizado en lugar del botón Enviar del formulario HTML (en este caso, el botón llama a la función save() personalizada).

Intenté usar la función submitForm() pero sin éxito.

¿Cómo puedo hacer esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que puede manejar el procesamiento del formulario en la función de save (y posiblemente eliminar la función onSubmit ).

 const { errors, values } = useForm(); const save = () => { showSaveSnackbar.value = false alert(JSON.stringify(values.value, null, 2)); };
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!