I would like to know whether it is possible to pass parameters from a javascript function (in a HTML form). Your help would be highly appreciated.
A:
Could you elaborate on what you are trying to do? Are you looking to return a set of values from a JavaScript function?
mishrsud
2009-10-15 09:51:30
+1
A:
If you want some values in your JavaScript to be added to the POST generated by the form, pop their values into hidden fields.
<form name="myform" method="post" onsubmit="return myFunction();">
<input type="hidden" name="calculatedTotal" value="">
<input type="submit" value="Go">
<script type="text/javascript">
function myFunction() {
document.myform.calculatedTotal.value = (100 / 4);
return true;
}
</script>
Sohnee
2009-10-15 12:09:13