[ create a new paste ] login | about

Link: http://codepad.org/CGY47E1G    [ raw code | output | fork ]

PHP, pasted on Jul 6:
<?php

function CreateMainSelect()
{
    $html = "<select name=\"main_select\" onChange=\"test()\" id=\"main_select\" >";
    $html .= "<option value='all'>All</option>";
    $html .= "<option value='past'>Past</option>";
    $html .= "<option value='current_and_future'>Current and Future</option>";
    $html .= "<option value='date_range'>Date Range</option>";
    $html .= "</select>";

    return $html;
}

echo CreateMainSelect();
echo '<script type="text/javascript">';
echo 'function test()';
echo '{';
echo 'alert("hello world");';
echo '}';
echo '</script>';
?>


Output:
1
<select name="main_select" onChange="test()" id="main_select" ><option value='all'>All</option><option value='past'>Past</option><option value='current_and_future'>Current and Future</option><option value='date_range'>Date Range</option></select><script type="text/javascript">function test(){alert("hello world");}</script>


Create a new paste based on this one


Comments: