Advertisement

07.24.2008 at 01:23PM PDT, ID: 23593660
[x]
Attachment Details

How can I concatenate a variable of a JS within a php line?

Asked by italoestrada in PHP for Windows, JavaScript

Tags: java scrip PHP, internet explorer 7

Hi

I need to concatenate a js variable (js function) in a php line. I would like to pass the complete link via xml.

Here's the code

Function selectCodigo(){
      xmlview = '<?php echo '/views/purchases/viewQueries/pending_to_pay.xml.php'; ?>';
      code = document.getElementById('fiscalCo').value;
      code = xmlview+'?filtro='+code;
      alert(code);
      code = '<?php encode_path('\'code\'') ?>';  // here's the problem, I need to introduce the 'code' variable in my php function (encode_path) in order to get the full link.
      return code;            
  }
after that I call the js function in my php script

this is my php line where the name js
$SelectBoxFi='<select id="fiscalCo" class="SelectBox" name="fiscalCo" size="1" class="" ONCHANGE="refreshTree('.'mygrid12'.',\\selectCodigo()'.'\\);">';      

I hope you can help me            Start Free Trial
[+][-]07.24.2008 at 08:47PM PDT, ID: 22085856

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP for Windows, JavaScript
Tags: java scrip PHP, internet explorer 7
Sign Up Now!
Solution Provided By: ryancys
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628