# \[Pro\] Javascript for Search Field, Safari problems

**URL:** https://discourse.softpress.com/t/pro-javascript-for-search-field-safari-problems/23703
**Category:** Dynamo
**Created:** [February 24, 2017, 7:05am UTC](https://discourse.softpress.com/t/pro-javascript-for-search-field-safari-problems/23703 "2017-02-24T07:05:31Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![JDW](https://discourse.softpress.com/user_avatar/discourse.softpress.com/jdw/32/2729_2.png) [@JDW](https://discourse.softpress.com/u/JDW)
#### Post date: [February 27, 2017, 5:17am UTC](https://discourse.softpress.com/t/pro-javascript-for-search-field-safari-problems/23703/13 "2017-02-27T05:17:42Z")

</div>

Walter, you have not failed me. Nevertheless, I don’t want any Submit buttons. To me, that is a bit retro. I like the “type and hit return” approach.

So I did more research and found I could leverage the browser cache to resolve the Safari problem, as per this page:

> **[WebKit Page Cache II – The unload Event](https://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/)**
>
> Previously I touched on what exactly the Page Cache does and outlined some of the improvements we’re working on.

I edited my JavaScript and confirmed it is working in Edge on Win10, IE11 on Win8.1, Safari, Chrome (even Chrome 36 on WinXP), FF (even FF48 on XP), and iOS 10 & iOS8.1 via the iOS Simulator on my Mac.

Try it:

[https://kiramek.com/search-test2.html](https://kiramek.com/search-test2.html)

Type “alarm” and hit return. Notice how the search results appear just fine. Then click the browser BACK button. Form gets reset perfectly! (No keywords stuck in the search field.)

–James W.

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:

> **[Information for existing FreewayTalk / Groups.io users](https://discourse.softpress.com/t/information-for-existing-freewaytalk-groups-io-users/24891)**
>
> The purpose of this topic is to provide information about the migration from FreewayTalk and Groups io to Discourse and the differences in Discourse, as well as a place to discuss the good or bad of the migration. For those previously subscribing...

---

_[View the full topic](https://discourse.softpress.com/t/pro-javascript-for-search-field-safari-problems/23703)._
