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

152
Vistas
Assigning multiple variables in one URL (Javascript)

I'm having problem passing multiple values.

setting a variable from a table in javascript funtion.

<td><input type="Button" value="Remove" onclick="deletefn(<?php echo $row['SKU'] ?>);"></td>
<script>
function deletefn(sku){

        location.assign('delete.php?prosku='+sku);
        }
</script>

But if try to put 2 variables like this it doesn,t work

<td><input type="Button" value="Remove" onclick="deletefn(<?php echo $row['SKU'] ?>,<?php echo $row['Part_no'] ?>);"></td>


<script>
function deletefn(sku,part){

        location.assign('delete.php?prosku='+sku);
        location.assign('delete.php?partx='+part);
        }
</script>

where am I doing mistake? Can someone help?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The problem isn't with the function parameters, it's that only the first location.replace() has any effect, since it redirects and the JavaScript on this page stops running.

Assuming delete.php accepts multiple parameters, put them both in the same URL.

function deletefn(sku,part){
    location.assign(`delete.php?prosku=${sku}&partx=${part}`);
}
about 4 years ago · Juan Pablo Isaza Denunciar
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