Calling a parameterized javascript function from php
<p>I need to call a javascript function from php, by passing a value in php variable. My code goes like this:</p>

<pre><code>echo '&lt;tr class="trlight"&gt;&lt;td onclick="callVehicle('.$qry_vehicleid.');"&gt;&lt;label&gt;Call Vehicle&lt;/label&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;';
</code></pre>

<p>And in javascript file I try to execute the following code:</p>

<pre><code>function callVehicle(vid)
{
alert('Call '+vid);
document.getElementById("SearchResult").style.visibility="hidden";
}
</code></pre>

<p>and an error <code>test is not defined</code> occurs. <code>test</code> is the value that I assigned to variable <code>$qry_vehicleid</code>. Can someone please point out what the mistake is?</p>
