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

328
Views
Envíe un formulario solo cuando se presione la tecla 'enter'

Tengo una entrada como esta que envía un formulario en el evento de activación:

 <input id="filter_package_byidphrase" asp-for="@Model.FilterByPackageIdPhrase" class="package_list_list_filter_controll_input" onkeyup="this.form.submit()">

Quiero que el formulario se envíe solo cuando se presiona 'enter' (arriba). Ya probé una solución como esta, pero no funcionó:

 <input id="filter_package_byidphrase" asp-for="@Model.FilterByPackageIdPhrase" class="package_list_list_filter_controll_input" onkeyup="keypressHandler"> <script type="text/javascript"> function keypressHandler(e) { if(e.keyCode == 13) { e.preventDefault(); $('#filterform').submit(); } } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podría ser útil activar la función dentro de la etiqueta desde el padre. Como esto

 <form id="myform" onsubmit="event.preventDefault()"> <input type='text' id='input' onkeyup="keypressHandler(event)" /> </form> <script> function keypressHandler(e) { if(e.keyCode == 13) myform.submit(); } </script>
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!