How to change return key text in Mobile Safari keyboard without form tag?

I want to change the text of the back button on the Safari Mobile keyboard when my input element is focused. I know you can do this:

<form action="somewebsite.com"> <input id='SearchTextBox' type="search"/> <input id='SearchButton' type="button" value="Search" /> </form> 

But I do not want the form tag, because the search is ajaxian (I do not want to reload the page).

Does anyone know if this is possible?

+4
source share
1 answer

Heh, I had to think about it (a colleague decided). Just cancel the form submission using JavaScript. For instance:

 <form action="#" onsubmit="return false;"> <input id='SearchTextBox' type="search"/> <input id='SearchButton' type="button" value="Search" /> </form> 
+6
source

Source: https://habr.com/ru/post/1346276/


All Articles