I have used PHP to echo out 2 long select statements with onchange events attached via a javascript file.

Problem is the function update_search_estimate is not firing at all - tested by putting alerts in the JS.

Please help.

<?php
echo "<select id='age_select_1' name='age_select_1' onChange='update_search_estimate'>";											
for($i = 18; $i < 100; $i++)
{
echo "<option value='$i'>$i</option>";
}
echo "</select>";

echo "  and  ";

echo "<select id='age_select_2' name='age_select_2' onChange='update_search_estimate'>";											
for($j = 18; $j < 100; $j++)
{
echo "<option value='$j'>$j</option>";
}
echo "</select>";
?>

    I believe it should be onChange='function_name();' which means in your case it would be:

    onChange='update_search_estimate();'

    HTH

      Blatent schoolboy error - realised the second you posted the answer.

      Thanks

        Write a Reply...