Click to See Complete Forum and Search --> : Forms issue in IE7/possibly IE6


TyeM
01-22-2008, 09:21 PM
Hello,

I am after some advice. I am finishing work on a site and I have something I can not solve and I am looking for some input.

I have a search form on the site. In IE only when the user types in data and presses enter the values don't get passed. They are forced to press the button manually to trigger the search.

Has anyone come across this issue and know a way to get it to work?

nickelleon
01-24-2008, 03:37 PM
Can you provide a link to the webpage that is doing this? If its not online, can you please place the code in a forum reply?

dtm32236
01-24-2008, 03:42 PM
http://jennifermadden.com/javascript/stringEnterKeyDetector.html

TyeM
01-24-2008, 04:07 PM
Thanks for the javascript link. But javascript is something I was hoping to avoid using. I will accept it as a last resort.

The link is http://www.medicinegarden.com.au

nickelleon
01-25-2008, 02:05 PM
I was able to duplicate the problem. Can you provide the source code for callbacks.php? Somethings not completing in there.

TyeM
01-25-2008, 04:53 PM
Below is an extract from callbacks.php that is of relevance to the search form. It redirects to the relevant page. All buttons throughout the site are named "submit_**" where ** is than checked in the callbacks.php file through a case/switch statement, then the redirection occurs.

I realize this is a HTML forum, but I was told that this is not a PHP issue and the suggestion was to keep the topic here.



function whichSubmit($get_array){
$num_of_get = count($get_array);

//print_r($get_array); // show entire $_GET array

foreach($get_array as $key => $value){
//echo $key."<br />";
$submit_array = split("_", $key);
if($submit_array[0] == "submit"){
//echo "<strong>Found Submit</strong><br />"; //test if found submit_<name>
//print_r($submit_array);
return $submit_array;
}else{
//return false;
}
}
}

if($_GET){
$which_submit = whichSubmit($_GET);
}


if($which_submit != false){
switch($which_submit[1]){

case "search":
//get search string
$searchcriteria = $_GET['searchcriteria'];


if($searchcriteria == ''){
$searchcriteria = 'all';
$url = "searchresult.php?category=" . $searchcriteria;
}else{
$url = "searchresult.php?searchcriteria=" . $searchcriteria;
}
//echo "The current URL is: " . $url . "<br />";
header( 'Location: '.$url ) ;

break;
}
}

TyeM
02-22-2008, 06:24 PM
Well for those who come by in the future the solution is:

There is an IE bug that prevents form submittion if there is only one textfield and one submit button. To get around it place a second textfield and make it invisible using CSS. Found this on 4GuysFromRolla.com.