Suman,
I'm not really sure where the calc() method comes into your example, but the "onfocus echo" bit is doomed to failure. PHP is a server-side tech. and requires the browser to be refreshed to display new information. This is because the PHP code needs to be interpreted by the interpreter on the server.
The form is trying to make the browser interpret a PHP echo statment as a JavaScript function or statement. Since PHP isn't JavaScript, JavaScript is logically throwing an error. If you're intending on trying to call the calc() method with onfocus, that's also not going to work unless calc() is a JavaScript function.
To use calc() in PHP, you need to call and use it in the body of the script which is passed to the interpreter on the server. As far as the the browser is concerned, calc() doesn't exist since it (the browser) never gets to see the PHP code, only the HTML output resulting from the PHP code.
Does this answer your question?
Geoff A. Virgo