I want to do something simple. I have two text boxes and want to calculate the value of the two entries with a function but I just can't grasp the concept of extracting values from two text boxes.
Any help will be appreciated.
Expand|Select|Wrap|Line Numbers
- Enter this week's total hours <input name="hours" type="text"><br />
- Enter the hourly rate of pay <input name="rate" type="text"><br />
- <input name="submit" type="button" value="Calculate Gross Pay" onClick="calcPay(form..hours.value)">
- </form>
- <script type="text/javascript">
- function calcPay (total) {
- document.write (total);
- }
- </script>