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

155
Views
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 answers
Answer question

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 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!