i am using an HTML5 input field on a get form to implement search on my site:
<input type="search" name="q" placeholder="search" value="">
everything works, but after the first search the search string the user entered is not saved in the search field, rather the placeholder
attribute value is displayed again.
after the first search i would like to have the search string the user entered displayed in the search field on the form.
that means that value
attribute of the input field needs to be "" before the first search (so that the placeholder
attribute value will display) and then dynamically updated after the first search.
I understand from the Mozilla documentation on <input type="search">
that the value the user entered is stored in the DOMstring "searchTerms = mySearch.value;"
but my programming skills and experience are limited.
i am not using php, thank-you in advance.