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

130
Views
Cómo pasar parámetros en "Presione Enter" jquery php

Estoy trabajando con jquery y php, tengo un cuadro de texto de tipo de entrada y quiero ejecutar la función con "hacer clic" O "Presionar el botón Intro" Pero el problema es que estoy tratando de pasar parámetros (a través de atributos de datos) a otra función entonces nada funciona, aquí está mi código

 <input type="text" id="txt" class="feed_in_input fi1" name="">

Aquí está mi guión

 $('.fi1').keypress(function(e) { if (e.which == 13) { e.preventDefault(); handleClickAndEnter(e); } }); $('.feed_reply_smiley').on('click', function(e) { handleClickAndEnter(e) }); function handleClickAndEnter(e) { var txt_id = $(this).attr('id').replace('button', 'txt'); var vals = $('#'+txt_id).val(); var pst=$(this).data('pst'); var cst=$(this).data('cst'); var pidd=$(this).data('pidd'); alert(txt_id + vals); .....ajax code .... }

Si solo uso la función "onclick", todos los parámetros pasan correctamente, pero quiero pasar parámetros en ambas condiciones ("onclick" o "Presione el botón enter") ¿Cómo puedo hacer esto? ¿Dónde estoy equivocado? Gracias por adelantado

about 4 years ago · Juan Pablo Isaza
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!