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

146
Visualizações
fill iframe input field on button click, filled in fields deleted if manually interact/fill in other input fields, submit data marks fields as empty

I'm trying to create a visual questionare that works in a way that if a user clicks on a button, that button's data attribute is taken and filled in into the iframe's fields. However, if you try to manually add in any additional info or interact in any way with the iframe, it removes all the auto-filled info.

Also if you try to submit the info it says that the input fields are empty.

Kind of stuck here.

<html>
<a href="#" onclick="autofill(this)" data-filled-value="USA">United States of America</a>
</html>

<script>
function autofill(element)
{
    $("#form-iframe").contents().find("#country-field").val(element.dataset.filledValue);
    evt.preventDefault();
 
}
</script>
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