Skip to content

Instantly share code, notes, and snippets.

@roycehaynes
Created May 15, 2013 17:41
Show Gist options
  • Save roycehaynes/5585819 to your computer and use it in GitHub Desktop.
Save roycehaynes/5585819 to your computer and use it in GitHub Desktop.
Here's an example...
<html>
<head>
<title></title>
<script type="text/javascript">
function calculatePrice(){
var form = document.forms['computePrice'];
var numOfUnits = form.elements['numOfUnits'].value;
var leadTime = form.elements['leadTime'].value;
// do you calculation here
}
</script>
</head>
<body>
<form name="computePrice" onSubmit="JavaScript:calculatePrice();">
<label># of snoe shoe units</label>
<input type="text" name="numOfUnits" />
<label>Lead Time</label>
<input type="text" name="leadTime">
<input type="submit" value="Submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment