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

182
Visualizações
How to get the javascript on-change function value in html template to Django views

Here is my script in html template

'''function yesnoCheck() {

  if (document.getElementById('yesCheck').checked) {
      siv=document.getElementById('ifYes').style.display = 'block';
      // siv = document.getElementById("yesCheck").value;
      document.getElementById('ifNo').style.display = 'none';
      alert(siv);

  }
  if (document.getElementById('noCheck').checked) {
      document.getElementById('ifYes').style.display = 'none';
      srv=document.getElementById('ifNo').style.display = 'block';
      alert(srv); 

  }

}'''

Below is my views code

      '''if request.method =='POST':
           if request.POST.get('basis1')=='here i need the data from alert(siv)' 

                return render(request,'stockissue2.html')
           elif request.POST.get('basis2')=='here i need the data from alert(srv)':
         
                    messages.success(request,'Record Saved Successfully...!')
                    return render(request,'stockissue2.html')
           else:
                 messages.info(request,'Material Not Available or Transaction No. wrong') 
                 return render(request,'stockissue2.html')'''

Please help me out..

about 4 years ago · Santiago Trujillo
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