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

249
Visualizações
javascript form.action pass a javascript variable as url parameter

I have a javascript function which acts as a submit for a ColdFusion program. The argument 'basetab' is a variable in the program.

<form 
    name     = "pers3form"                      
    method   = 'post'        
    onsubmit = "person2('#basetab#')">

Here is the javascript. The Id's nexter, prever,xrepem are created from a radio list within the form. The target is a variable that exists in the form and the javascript is picking it up correctly.

 function person2(target){

 var a = document.getElementById('nexter').checked;
 var b = document.getElementById('prever').checked;
 var c = document.getElementById('xrepem').checked;
   if(a == true || b == true){
   document.pers3form.action ="persnextprev.cfm";}

   else if (c == true) {
   document.pers3form.action = 'xrepem.cfm';} 

   else {  
   document.pers3form.action = 'screen1.cfm?basetab=target';}
 return true; 
}

When the action is to screen1 the basetab is picked up as a url in screen1. But it picks up the name 'target' instead of the value of target, which is the real basetab.

Is there a way to pass the value of target instead of the string?

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