View Single Post
  #1 (permalink)  
Old Apr 26th, 2007, 19:46
Donny Bahama Donny Bahama is offline
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 236
Thanks: 4
Thanked 0 Times in 0 Posts
Strange form submit behavior in IE

I have a form in one php page (addcomment.php) that submits to another (antibot.php) The code is below:
Code: Select all
<h2>User Login</h2>
<div class="loginwrap"><div class="badrobot">
<img src="img/badrobot.jpg" width="190" height="358" alt="BAD ROBOT!"></div>
<div class="loginexplan"><p>You have to log in before your message will be posted. But 
<strong>don't worry</strong> - this is <em>very</em> easy, and will only take you a minute. 
Best of all, you should only have to do this once. After that, this website should recognize 
you and you'll be allowed to post comments on all DHS57 interactive pages without logging in again.</p>
<p>This minor security measure is made necessary by 'bad robots' all over the internet. 
Without this, the interactive pages of DHS57.com (like the one that brought you here) would 
be filled with nasty, vulgar things that no one really wants to see. (Or maybe you do, but not 
here you won't!) If you want to know more about internet 'robots', you can 
<a href="antibot.php">click here</a>.</p>
<p><strong>Note:</strong> If you're seeing this page every time, please 
<a href="contact.php?msgid=57119">ask the webmaster for assistance</a>.</p>
</div>
<div class="clearing"></div>
</div>
    <h4>Steps for logging in:</h4>
    <ol><li>Enter the first three or four letters of your last (or maiden) name in the box below. 
    (You may enter in your entire last/maiden name if you like.)</li>
    <li>Click the &ldquo;Look Me Up&rdquo; button</li>
    <li>Follow the simple instructions on the next page.</li>
    <div class="namelookup">
        <form action="antibot.php" method="post">    
        <input type='hidden' name='return2' value='<? echo $return2; ?>'>
        <input type='hidden' name='eventid' value='<? echo $eventid; ?>'>
        <input type='hidden' name='postmsg' value='<? echo $postmsg; ?>'>
        <br><label for="cmname">Last name</label><br>
            <input type="text" name="cmname" size="20" maxsize="20"> 
            <input class="lookupbutton" type="submit" name="lookmeup" value="Look Me Up">
        </form>
    </div>
If $_POST['lookmeup'] isn't set in antibot.php, it displays an informational page about bots, comment spam, etc.

Here's where the weirdness comes in...

In FF, I can type a name into the cmname input and hit enter - and FF behaves as it should. But in IE, I have to actually click the "lookmeup" (submit) button. If I don't - if I just hit the enter key, antibot.php behaves as though $_POST['lookmeup'] isn't set.

Has anyone ever encountered anything similar? Is there any kind of workaround? Thanks in advance!
Reply With Quote