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

92
Views
pasando dinámicamente href en la etiqueta de anclaje

Quiero redirigir al usuario al registro según su función. como si hubiera dos funciones, usuario y tienda, si el usuario selecciona la función de usuario, se dirigirá a ragic.php (cliente de registro) si seleccionó la tienda, entonces ragis.php Escuche el código...

 Link: `<td colspan=3 align="center"><font size=6 ><a onclick="return check_role()" href="" id="ref" name="Ragistration">Ragistration</a>` Selecting Role: <select id="role" name="role"> <option value="ragic.php">user</option> <option value="shop/ragis.php">shop</option> </select> Java Script Function : function check_role() { var r=document.getElementById('role').value; alert(r); document.getElementById("ref").value = test; }

un problema es cómo paso una variable javascript a ancla href. o también intento que php escuche el código

 if(@isset($Ragistration)) { if(@$role=="shop") $r="shop/ragis.php"; elseif(@$role=="user") $r="ragic.php"; }

y para la etiqueta de anclaje de php será <a href="<?php echo $r?>" ></a>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Actualice su función de JavaScript de esta manera:

 function check_role() { var r=document.getElementById('role').value; alert(r); location.href = r; }
about 4 years ago · Juan Pablo Isaza Report
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!