Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
Run JavaScript after Form Submit (Wordpress + WPPayForm)

I have a payment form on my Wordpress page and I would like to run a javascript code, after the form submit.

This is the code I'd like to submit:

ny.track({name: (new URL(window.location.href)).searchParams.get("utm_source"), value: 24.50, unit: "CHF"})

This is what I have on my Wordpress page:

jQuery(".wpf_submit_button").submit(function() {
     ny.track({name: (new URL(window.location.href)).searchParams.get("utm_source"), value: 24.50, unit: "CHF"});
    });

Unfortunately, this does not seem to work. If I change this to fire on click (eg. jQuery(".wpf_submit_button").click(function... then it works without any problem, so I'm not sure what I'm doing wrong. Here is the link to a testpage with the code implemented. I am using WPPayForm for the payment form.

Any help is greatly appreciated!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

.submit() is bound to the "Submit" javascript event according jQuery documentation. You should use your form id instead of the button class as jQuery selector:

jQuery("#wpf_form_id_354").submit(function() {
 ny.track({name: (new URL(window.location.href)).searchParams.get("utm_source"), value: 24.50, unit: "CHF"});
});

Check jQuery docs: https://api.jquery.com/submit/

The submit event is sent to an element when the user is attempting to submit a form. It can only be attached to <form> elements.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda