Results 1 to 2 of 2
  1. #1
    Eric is offline Senior Member
    Join Date
    Jun 2007
    Posts
    111
    Rep Power
    0

    Default Javascript and enter button

    I have a system in which I did a login page with javascript to validate some fields. It works fine when I click on the send button, but I want the same thing in the enter button, Do you know how can I add the validation function to the event of the enter button?

    Eric

  2. #2
    Daniel is offline Member
    Join Date
    Jun 2007
    Posts
    91
    Rep Power
    0

    Default RE: Javascript and enter button

    The form has an event "onsubmit" (like the input that have onclick), the idea would be that event calls your validation function.
    Check this, I think that it is the solution

    Java Code:
    <script language="Javascript" type="text/javascript">
    function validateForm(){
        ...
    }
    </script>
    
    <form method="post" name="createform" onsubmit="validateForm()">
        ...
    </form>
    Daniel:o

Similar Threads

  1. Replies: 2
    Last Post: 04-16-2008, 01:18 PM
  2. Applet - enter URL and view the page
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-10-2008, 03:38 PM
  3. Reading Char without needing to press enter
    By x0psci in forum New To Java
    Replies: 0
    Last Post: 11-23-2007, 05:28 PM
  4. enter data from an optic device
    By bbq in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 09:02 AM
  5. Jsp and javascript
    By Ed in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-04-2007, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •