Calling a JS function in PHP
<p>I know it`s possible to call javascript functions in php and it has worked but when i try to call checkSecondValue, nothing happens. I have included my variations on calling the function.</p>

<p>Edit: If i try to call it at the bottom without activating the onChange event in the select, it won`t work.</p>

<pre><code>&lt;!--&lt;html&gt;
&lt;head&gt;
    &lt;script type="text/javascript" src="validation.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
&lt;/html&gt;

&lt;script src="validation.js" type="text/javascript"&gt;&lt;/script&gt;
--&gt;
&lt;?php
    //retrieve all the bris for the drop down
include '../../inc/database.php';
$res = BbqcDatabase::getInstance()-&gt;doQuery('SELECT * FROM T_TOURNOI_BRIS');
$str = "&lt;select name='ddlBrisSelected' id='ddlBrisSelected' onChange='checkSecondValue()'&gt;";

$bris = ($_GET['bris']);

if($bris == 4)
{
    $bris2 = "autre";
}

if($bris == null)
{
    $str .= "&lt;option value='' selected&gt;&lt;/option&gt;";
}
else
{
    $str .= "&lt;option value=''&gt;&lt;/option&gt;";
}

$i = 0;
while($data = mysql_fetch_assoc($res))
{
    if($data['F_BRISID'] == $bris)
    {
        $str .= "&lt;option value='" . $data['F_BRISID'] . "' selected '&gt;" . $data['F_BRISTITLE'] . "&lt;/option&gt;";
    }
    else 
    {
        $str .= "&lt;option value='" . $data['F_BRISID'] . "'&gt;" . $data['F_BRISTITLE'] . "&lt;/option&gt;";
    }
}

if($bris2 == "autre")
{
    $str .= "&lt;option value='autre' selected&gt;Autre&lt;/option&gt;";
}
else
{
    $str .= "&lt;option value='autre'&gt;Autre&lt;/option&gt;";
}
$str .= "&lt;/select&gt;";

echo $str;

if(is_numeric($bris))
{
    /* echo "&lt;SCRIPT language=\"JavaScript\" SRC=\"validation.js\"&gt;checkSecondValue();&lt;/SCRIPT&gt;"; */
    /* echo "&lt;script&gt; checkSecondValue();&lt;/script&gt;"; */
    /* echo "&lt;script type=\"text/javascript\"&gt;checkSecondValue();&lt;/script&gt;"; */
    /* echo '&lt;script type="text/javascript"&gt;', 'checkSecondValue();', '&lt;/script&gt;'; */
    /* echo "&lt;SCRIPT LANGUAGE='javascript'&gt;checkSecondValue();&lt;/SCRIPT&gt;"; */
}

?&gt;
</code></pre>
