ZenphotoCMS Forum
Search form without submit button - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Search form without submit button (/thread-8561.html)



Search form without submit button - jackdaw - 2011-04-29

Is it possible to make the searchform work by hitting enter and not by using the submit button? I use the searchbox this way in my website (WordPress) and like the ZP part of the site to look identical.




Search form without submit button - acrylian - 2011-04-29

For me it does work with hitting just enter both on our site and on my test site actually.




Search form without submit button - jackdaw - 2011-04-29

Of course... Never tried that.
I looked at the printsearchform function but can't see a way to add a text into the search input field, a text like 'search here'.




Search form without submit button - acrylian - 2011-04-29

The function has no option for that (we have the button..;-)). Either make a custom theme function out of it or add the text via jQuery for example.




Search form without submit button - jackdaw - 2011-05-02

I hid the submit button with css, but somehow I didn't manage to do the same with the toggle button. Also when I added a search term, and after that wanted to search for something else, the input field shows an AND and searches for both words. In the options page I chose for 'space' and not for OR or AND.

example on the left




Search form without submit button - acrylian - 2011-05-02

You need that icon button to set the search free again. The search engine always searches within the results of the previous search otherwise. The setting for space or AND/OR has nothing to do with this.




Search form without submit button - jackdaw - 2011-05-02

'The search engine always searches within the results of the previous search...'

And this can't be disabled in any way? I really like a search bar as simple as can be. Too many options can be confusing for visitors imho.




Search form without submit button - acrylian - 2011-05-02

As far as I remember the only way would be to make a custom function out of printSearchForm(). Sbillard surely knows more in case I missed anything.

Btw, this search within results was added on several user requests.




Search form without submit button - jackdaw - 2011-05-02

I escaped some lines in template-functions.php and now I have what I wanted

The search within search sounds good, and perhaps I will use it someday. But for my own site and also probably for a lot of others, it would be nice to have an option on the admin search page which kind of search someone wants.




Search form without submit button - sbillard - 2011-05-02

You can clear the search parameters. This was discussed in the past on the forum, maybe ou can do a search and find the thread.