So the code that I have so far is:
I found w3schools.com howto, their try me page is at the following.
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_trigger_button_enter
This worked in my regular browser but did not work in my php app which uses the built in php browser.
After toying a bit I came up with the following pure JavaScript alternative that works for my situation and should work in every other situation:
function checkForEnterKey(){
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("myBtn").click();
}
}
function buttonClickEvent()
{
alert('The button has been clicked!');
}
HTML Press the enter key inside the textbox to activate the button.