I have a generic JavaScript function which takes one parameter
function foo(val) { ...}
and I want to call the function when submit a form
Use onclick="foo(document.getElementById('formValueId').value)"
onclick="foo(document.getElementById('formValueId').value)"