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

218
Views
how to pass javascript variables in php function

I have these javascript variables:

  $('#modalDescription').html(item.description);
  $('#exrtas-area-inside').append('<div class="custom-control custom-checkbox mb-3">
  <input onclick="recalculatePrice('+id+');" class="custom-control-input" id="'+element.id+'" 
  name="extra"  value="'+element.price+'" type="checkbox"><label class="custom-control-label" 
 for="'+element.id+'">'+element.name+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+'+element.priceFormated+'
  </label></div>');
          

these variables "item.description" and "element.name" I want to pass in php function.

Php function which is in common php file:

      function trsText ($text){  here language translation code }

now I want to pass the js parameters in that function to translate them, as I am translating php variables easily, but here name and description are coming from js code so I want to pass them in that particular php function.

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!