I was able to get this issue resolved with your son.
Your top.php page had a label tag that surrounded both the input and the button. So when you clicked on the input field, you were technically clicking in the <label> and the first form element in that label was the button, so it was submitting the form.
The solution was to replace the label tag with a div tag. I think it may have also worked if I added a for="inputname" attribute to the existing label tag to it knew the label was for the input and not the button, but I don't think the label tag is necessary since you don't actually have a label in the code.