This form is meant to be a trip cost calculator based on the users input, however I would like the output to appear automatically with the given input values.
Basically I want the page to load with the "Total Cost" already calculated with the preset inputs, and then change when the inputs change. I could not find an alternative form event to "oninput" that would output the "Total Cost" without user input. If anyone can give me some sort of workaround for this it would be much appreciated. And I hope this all makes sense, I have limited coding experience and feel I am making an easy task more difficult than it has to be.
HTML:
<html>
<head>
<title>Trip Cost Calculator</title>
</head>
<body>
<p align="center" style="color: #00416a; font-weight: bold; font-size: 24px;">ACV<br>Humboldt County Airport</p>
<form style="background-color: #87ceeb; border: 3px solid #00416a; padding-left: 25px; padding-right: 25px; padding-bottom: 25px;" oninput="ACVTotal.value=parseInt(ACVair.value)+parseInt(ACVpark.value)*9 + 0 + 0;">
<br>
<label style="font-weight: bold;">ACV Air Fare Cost:</label><br>$
<input type="number" name="ACVair" value="200"><br><br>
<label style="font-weight: bold;">ACV Mileage:</label><br>$0<br><br>
<label style="font-weight: bold;">ACV Travel Time Cost:</label><br>$0<br><br>
<label style="font-weight: bold;">Number of Days Parking at ACV ($9/day):</label><br>
<input type="number" name="ACVpark" value="5">
<br><br><br>
<label style="color: #00416a; font-weight: bold; font-size: 18px;">Total Cost:</label><br><p style="color: #00416a; font-weight: bold; font-size: 18px;"> $ <output name="ACVTotal" style="color: #00416a; font-weight: bold; font-size: 18px;"></output></p>
</form>
</body>
</html>
Basically I want the page to load with the "Total Cost" already calculated with the preset inputs, and then change when the inputs change. I could not find an alternative form event to "oninput" that would output the "Total Cost" without user input. If anyone can give me some sort of workaround for this it would be much appreciated. And I hope this all makes sense, I have limited coding experience and feel I am making an easy task more difficult than it has to be.