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

337
Vistas
How to get input value from virtual field added by jquery field repeatable, before save

Fields created by repeatable plugin from Rhyzz at https://www.rhyzz.com/repeatable-fields.html and works correctly to pass values to the database.

I need to get value from the virtual text input field using $("#vids_fid0_url").on("input", function() {}) before the field is submitted, to avoid multiple steps by the user which involves saving to make the field available in the HTML document, then do the steps to enter field value and save again.

Expected result

When a Youtube URL is entered into the field labeled URL, a button should display at the right of the row and the video title should be taken from the remote JSON object and entered into the field labeled Title

image snap of fields created by repeatable

The code

$("#vids_fid0_url").on("input", function() {
    
    if( $(this).val().search(/youtu/i) != -1 ) {
        $("#get_ytimg_btn").show();
        url = $(this).val();
        $.get("https://www.youtube.com/oembed?url="+url+"&format=json", function(data) {
            $("#vids_fid0_title").val(data.title);
        });
    }
    
});

The method doesn't execute because there is no literal HTML field with the ID unless the document is saved.

Tried

various addEventListener() formats without success

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