I am working on a project that basically asks the user for three numerical inputs, and then generates instructions based on what they entered once they click on the submit button. I was able to get it to work perfectly for what I needed on my desktop PC, but when I tried it on my iPhone 7 it does not work. It does, however work on my android phone using Chrome, so it is clearly an issue with Safari/iOS. Basically on my iPhone it allows me to type in the three input fields, however when I click on the submit button nothing happens. From what I've been seeing online it seems to be an issue with the onclick function that I am using, however I have tried the recommended fix of using cursor: pointer to no avail. I am also extremely novice at this (haven't used java/html in almost 20 years, and basically stumbled through what I have using tutorials and examples), so I haven't tried some of the solutions that didn't have great instructions on how to implement them. My full code is below to help anyone who is willing to assist me. I just want it to work on iOS the same way it works on other platforms.
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: #4CAF50;
border: none;
color: black;
padding: 6px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
div {
cursor: pointer;
position: relative;
width: 50%;
margin:auto;
left: 0;
right: 0;
text-align: left;
}
div.a {
word-wrap: normal;
}
</style>
</head>
<body>
<div class="a">
<h2>Ficus Hedge Treatment</h2>
</div>
<div class="a">
<p>This will tell you how much water and product is needed for treatment:</p>
</div>
<div class="a">
<b>Hedge Length in feet:</b>
<br><input id = "length" type = number></input><br><br>
<b>Hedge Height in feet:</b>
<br><input id = "height" type = number></input><br><br>
<b>Space Between in feet:</b>
<br><input id = "space" type = number></input>
<button type = "button"
onclick="myFunction2()" class="button">
Submit
</button>
</div>
<br>
<br>
<br>
<div class="a">
<b><p id="demo"></p></b>
</div>
<script>
function myFunction2() {
var input1 = document.getElementById("length").value;
var input2 = document.getElementById("height").value;
var input3 = document.getElementById("space").value;
var plants = input1 / input3;
var gals = plants + 1;
var totDominion = input2 * plants * 0.1;
var totFert = input1 * 6 * .0067
totFert = totFert.toFixed(2);
var mixrate = totDominion / gals;
mixrate = mixrate.toFixed(2);
document.getElementById("demo").innerHTML = "You will need to mix " + mixrate + " oz of Dominion per gallon, and use " + gals + " gallons of water. You will also use " + totFert + " pounds of 15-0-15."
}
function myFunction(a, b, c) {
return a * b * c;
}
</script>
</body>
</html>