I am having difficulties when calling Javascript functions from inside php. First of all, I assume that is possible?! Secondly, how do you do it? Currently I have:
echo myFunction($name1);
inside the php and the function is declared as:
function myFunction(name)
but this gives:
Fatal error: Call to undefined function myFunction() in C:\xampp\htdocs\page.php on line 109
Please Help!
myFunctionis your JavaScript function. So, you (probably) want the PHP to echomyFunctionas string:echo "myFunction({$name});";. You want the PHP to generate a JavaScript program.