ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Form "submit" error in Firefox/XP

February 18, 2008 5:51pm

Subscribe [2]
  • #1 / Feb 18, 2008 5:51pm

    redmercer

    35 posts

    I have a login form that works fine in all browsers except Firefox on Windows XP.

    Problem:

    When inputing ‘username’, then tabbing to ‘password’, then pressing “enter” on the keyboard, I get the error: “you must submit a username and password.”

    If I input ‘username’, then tab to ‘password’, then click the submit (GO) button with my mouse, I login fine.

    Here is my code:

    {if logged_out}
    {exp:member:login_form return="member/profile/"}
    CLIENT LOGIN    
    
    <input type="text" onFocus="this.value=''" tabindex="1" style="border:0; color:#666" name="username" value="username" maxlength="32" class="input" size="13" />
    
    <input type="password" onFocus="this.value=''" tabindex="2" style="border:0; color:#666" name="password" value="password" maxlength="32" class="input" size="13" /> 
    
    <input type="submit" tabindex="3" style="border:0;background:#fe9d01;color:#fff;font-size:10px;padding-left:2px;padding-right:1px;padding-top:1px" value="GO" /> 
     
    <span class="control2">
    <a href="http://{path=member/forgot_password}">Forgot password?</a></span>
    
    {/exp:member:login_form}
    {/if}

    Anyone know a fix?

    Thanks,
    Redmercer

  • #2 / Feb 18, 2008 8:04pm

    Sue Crocker

    26054 posts

    Redmercer, I don’t have the same problem on FireFox running on Vista.

    Is this code on a standalone page? Will it work if it is?

  • #3 / Feb 19, 2008 12:38pm

    redmercer

    35 posts

    I tried it on a standalone page and got the same results.

  • #4 / Feb 19, 2008 12:54pm

    redmercer

    35 posts

    Looks like Firefox on Mac OS 10.4.11 does the same thing.

  • #5 / Feb 19, 2008 1:14pm

    Sue Crocker

    26054 posts

    Which Firefox build are you using?

  • #6 / Feb 19, 2008 1:19pm

    redmercer

    35 posts

    Both Mac and PC: Firefox 2.0.0.12

  • #7 / Feb 19, 2008 2:48pm

    Lisa Wess

    20502 posts

    redmercer, can you try with the default code from the docs for the stand alone login form, and see if that works for you in Firefox?

  • #8 / Feb 19, 2008 6:00pm

    redmercer

    35 posts

    Okay - right. Good troubleshooting. The default works fine. Which prompted me to pick apart a little more. The code that appears to be mucking up Firefox’s response is:

    onFocus="this.value=''"

    This is also the code that makes the default fields (“username”, for example) disappear when the cursor appears in the field, either by clicking in the field or tabbing to it.

    So, that sucks, because I’m trying to save space by having the labels for the log-in fields appear inside the field, but I want them to disappear for the user as described above. Anyone have any thoughts on why this is happening, how to work around it, anything else?

    Thanks much.

  • #9 / Feb 21, 2008 3:52pm

    redmercer

    35 posts

    I’ve done some searching, and found the following solution for anyone with the same problem.

    Instead of this code:

    value="username" onFocus="this.value=''"

    Use this code:

    onFocus="this.value= (this.value=='username') ? '' : this.value" onBlur="this.value= (this.value=='') ? 'username' : this.value" value="username"

    It works for the password field too. (By replacing “username” with “password”.)

    It is still not clear to me if the problem had anything to do with EE at all, since I did not test it outside of EE. So I don’t know if any of this belongs in the EE forums… Sorry?  :roll:

  • #10 / Feb 21, 2008 3:58pm

    Lisa Wess

    20502 posts

    I think this is probably a general HTML Issue, but thank you for posting the solution!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases