Posted by Matt on 08/09/06 10:37
"Markus Ernst" <derernst@NO#SP#AMgmx.ch> wrote in message
news:44d9a244$1_2@news.cybercity.ch...
> Matt schrieb:
>> I have an issue when trying to use an image type Submit for a search.
>>
>> The code below works fine in Firefox 1.5.0.6 but not in IE7 Beta 3
>>
>> <form method="post" action="<?php echo $PHP_SELF?>">
>> Search Edinburgh
>>
>> <!--<input type="Submit" name="search" value="Search">-->
>> "Search" button commented out, works in both IE7 Beta 3 and Firefox
>> 1.5.0.6
>>
>> <input type="Text" name="srchtxt" value="Enter Search Text">
>>
>> <input type="image" src="images/search.gif" name="search">
>> "Search" image works in Firefox 1.5.0.6 but not IE7 Beta 3
>>
>> </form>
>>
>> <?php
>> if ($_POST['search']) {
>>
>> $srchtxt=$_POST["srchtxt"];
>> echo "Results for \"$srchtxt\"<br /><br />";
>> include ("../../include/search.php");
>> } else {
>> include ("../../include/show.php");
>> }
>> ?>
>
> You should not check for the submit button anyway, as a form can be
> submitted by hitting the enter key. Check for the searchtext instead:
>
> if (isset($_POST['srchtxt']))
Thanks to all, I've gone with the above method and all is working fine.
Regards
Matt
Navigation:
[Reply to this message]
|