View Full Version : problem with search submit
jamie325853
06-18-2009, 04:03 AM
Hi wonder if anyone can advise on a small issue I have.
In internet explorer when you enter text in the keywords box to search and press the enter key on the keyboard to submit (IT WORKS CLICKING THE SUBMIT BUTTON) it does not post the values and just returns all products.
Here is the link to the site im building: http://78.129.143.18/~audio/index.php
if you type say rcf into the keywords box and hit the return key on the keyboard it does not perform the search, its one of those anoying little bugs that seems to be causing me problems.
Kind Regards
Jamie Jackson
Ray Borduin
06-18-2009, 09:01 AM
Change the trigger. Right now you are triggerring using the click of that button... instead trigger off of the form element value itself.
Oddly in IE if you have a form with only one form element it won't click the button when you press return... I think you may be able to add a hidden form element to make the button click happen as well it is an odd issue with IE.
digitaldesign
06-18-2009, 10:55 AM
Oddly enough I just encountered this same issue today and was coming out to search for an answer. THANK YOU Jamie for posting and THANK YOU Ray for the fix. It worked splendidly adding a non-used HIDDEN text field in the form. Enter key bug is exterminated!
Cheers,
Monica
digitaldesign
06-18-2009, 11:48 AM
Sorry for hijacking... it's still related to the same original topic.
It worked for 10 minutes... now they all come back with a full recordset (108 records). Whether clicking or entering. Hmm.... How would one trigger off of a form element value?
Right now the trigger is:
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
Which is the button name. Do you mean to change it to the name of the form:
if (isset($_POST["SiteSearch"])) {
Thanks!
Monica
*** EDIT ***
I found if I wrapped everything in this:
if (isset($_POST["searchtype"]) && ($_POST["searchtype"] == "data")) {
Using my hidden field for a validation it worked great. I also wrapped everything from the INCLUDE helper file as well as the recordsets in that boolean so that if they just happen to land on the results page without entering a keyword it just gives them a prompt to type a search keyword into the box.
***
Ray Borduin
06-18-2009, 11:51 AM
No I mean change it to the name of the form input field.
mcriecken380554
06-20-2009, 08:23 PM
I'm having this same problem, only no matter if i hit the enter key or press the submit button, it loads my results page with all of my inventory. I used the "DataAssist Search Wizard" to put a few search fields on my front page. Under the bindings and database panels it shows I have connections in both. I'm fairly new to PHP and MySQL, so I'm guessing it's something simple I'm missing. Thanks for any help.
-Matt
sales356151
06-21-2009, 03:51 AM
the only way i managed to resolve it was start again and it worked
mcriecken380554
06-21-2009, 02:37 PM
I figured out what I was doing wrong. On my results page under "server behaviors" I had about 3-4 different search behaviors, I believe they were conflicting with each other. Also, I made a very beginner mistake and forgot to upload my results page after I added the search function to my front page. When you use the DataAssist Search Wizard make sure you re-upload your results page too!
Jason Kline
06-22-2009, 04:29 PM
I have this issue with my PowerStore search. Just hitting the ENTER key shows all products.
I have changed the name of the form input field. But no luck.
I tried the hidden field. But no luck.
Where is the code do I change the name of the form input field so that my search works whether I hit the ENTER key or SEARCH button?
Ray Borduin
06-23-2009, 08:40 AM
On Products_Results.php.
at around line 31 Find:
if ((((isset($_GET["Search_x"]))?$_GET["Search_x"]:"") != "")) {
and replace it with:
if ((((isset($_GET["S_ProductName"]))?$_GET["S_ProductName"]:"").((isset($_GET["CategoryID"]))?$_GET["CategoryID"]:"") != "")) {
Jason Kline
06-23-2009, 03:22 PM
ok thanks. I did make that change previously and it worked. But now the "SHOW ALL" button under PRODUCTS does not show all products anymore. What it shows is the result from the search using the search box.
Ray Borduin
06-24-2009, 07:50 AM
In that case use so it will still work with the button as well:
if ((((isset($_GET["S_ProductName"]))?$_GET["S_ProductName"]:"").((isset($_GET["CategoryID"]))?$_GET["CategoryID"]:"").((isset($_GET["Search_x"]))?$_GET["Search_x"]:"") != "")) {
Jason Kline
06-24-2009, 01:53 PM
Thank you. That worked.
MarkBrock
03-13-2010, 06:08 AM
Change the trigger. Right now you are triggerring using the click of that button... instead trigger off of the form element value itself.
Oddly in IE if you have a form with only one form element it won't click the button when you press return... I think you may be able to add a hidden form element to make the button click happen as well it is an odd issue with IE.
Would it be possible for you to give an example of the hidden form element that you'd put into the code to make this work?
I've been trying to find a way around the same issue as raised in this thread to no avail.
MarkBrock
03-14-2010, 01:40 AM
Would it be possible for you to give an example of the hidden form element that you'd put into the code to make this work?
I've been trying to find a way around the same issue as raised in this thread to no avail.
No worries, I fixed it through trial and error.
Just in case someone else out there was having the same basic error and weren't sure what should be added to make the form submit with the enter key, here's what I added to the form...
<input type="text" style="visibility: hidden; position: absolute" />
This is probably common knowledge but if someone out there has only a basic understanding like I do then hopefully this will help them.
Ray Borduin
03-19-2010, 08:28 AM
That works.... or you could add a hidden form element to the field. For some reason when you hit return it will always include the form button as long as the form contains at least 2 fields. Oddly enough this seems to be an IE bug for forms with a single form element.
Your solution will work as well.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.