I know that PHP is server side, and Javascript is client side, but I have a case where I need to pass 2 PHP variables as parameters to a Javascript function that updates some text on screen.
Basic PHP skeleton code is:
echo'<input type="text" onchange="updatefn(var1, var2)">';
In this case var1 is a numeric and var2 is the id of the div holding the text that needs changing.
If I change var1 and var2 to actual values it works ok, but in the program I have two variables $var1 and $var2 that are.the ones that actually needed to be passed.
I have seen examples where one PHP variable is passed, albeit from an HTML statement not from a PHP echo statement, but am having problems trying to pass the two variables.
Many thanks