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

195
Visualizações
Intro.JS possible to check user input before proceed

So, i want to come out with the Javascript which forced user to input / select anything before going to next step, (like forced user to press button, input their name, etc). I am working on Django Framework with mix together with Javascript and HTML together.

Ignore the first part as I am trying to assign each function to the button so the button can do different tasks individually. But it wont work in the intro.js script. Code snipper are below:

 <script>
        /*
        var btn1=document.getElementById("button1");
        var btn2=document.getElementById("button2");
        var div=document.getElementById("InputName");
        
        btn1.onclick=function(){
        if (div.style.display !=="none") {
          div.style.display="none";
        } else {
          div.style.display="block";    
        }
        };
        // this is the crucial part
        btn2.onclick=function(){
            var steps=[
        {element:"#button1",intro:"A button", position:"right"},
        {element:"#button2",intro:"This goes away sometimes"}
         ];
          
          if (div.style.display==="none") {
              steps.splice(1,1);
          }
        
          introJs().setOptions({
          steps:steps
          }).start();
          
        } */

        var steps=[
        {element:"#InputName",intro:"Please fill your name", position:"right"},
        {element:"#InputUsername",intro:"Please fill your username"},
        {element:"#button1",intro:"Succesfully Filled, press register."}
        ];
         
        introJs().setOptions({
            steps:steps
            }).start();
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