Grow your CSS skills. Land your dream job.

Hitting on "Enter" on the keyboard to submit a form.

  • # October 23, 2009 at 4:03 pm

    Hello Chris (Great site, Appreciate all the work you put in)

    I am working on a site and the site has a form. The submit on the form is styled with text and css, so I have to use javascript to make it functional.

    But when I do that, my styling is there for the submit button, but it no longer behaves like a normal "Submit" button. I can’t just type in my user name and password and hit enter, you have to use the mouse and click the submit button.

    Any ideas how I can use the "Enter" key on the keyboard to "Submit" after I fill out the form.

    first the code for the javascript in the head:

    Code:

    Second, here is the html code for form:

    Code:
    # October 25, 2009 at 2:14 am

    Hey,

    The Enter function comes default with all browsers I have tried. But you need to have a <form> and an <input type="submit">

    You can read up on forms here: http://www.w3schools.com/html/html_forms.asp

    (I’m assuming you aren’t familiar with forms since there was no form tags attached. If this is wrong, let us know.)

    gl,

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".