Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

244
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda