I have a generic JavaScript function which takes one parameter
function foo(val) { ...}
and I want to call the function when submit a form
Well ya you can do that in this way.
Java Script
function showAddress(address){ alert("This is address :"+address) }
That is one example for the same. and that will run.