Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

330
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda