Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!