I try to make a button which execute java script function like this :
<?php
//make a function using JS
echo("<script>");
echo("function alert1(){");
echo("window.alert('alert')");
echo(" } ")
echo("</script>");
echo("<script>");
echo("function alert2(){");
echo("window.alert('alert')");
echo(" } ")
echo("</script>");
$jsfunc= array("alert1()","alert2()");
for($i=0;$i<2;$i++){
echo("<form method=post>");
echo("<input type=submit value=button onClick=$jsfunc>");
echo("</form>");
}
?>
but the javascript function cannot be executed ! How to make it executed when the button pressed ?
when i make :
...
<input type=submit value=button onClick=alert1()>
...
the JS function executed !!!