You would change the signature of your function to just function dosomething()
You would have to use unique ids on your textboxes and then you can get a reference using the id. Since jQuery is already included in the page you can use jquery to simplify the syntax
For example you have:
<input id="weight" size="5" name="weight" type="text" />
in js:
var weight = $("#weight").val();
read some jquery tutorials and you'll find how to do about anything you want.
without jquery the same example would be:
var weight = document.getElementById("weight").value;
Hope that helps,
Joe