Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How could a form without submit node be submitted?

    Hi, there,
    Please take a look of http://gsx.apple.com. When you look at the source of the page, you'll find the "key" element of "Log In" is just a image, like this:
    <TD ALIGN=left WIDTH="50%"><input border="0" type="image" name="1.Continue" src="/AppleConnect/US-EN/BtnGSXLogin.gif"></TD>

    My question is that there's no "onclick" to activate a javascript and no "submit" type input but it should belong to a form with "post" method to submit it. So how could it (the image) response to my click action to finish the login action?

    Thanks.
    Koifans

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,865
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    Inputs of type image are the same as submit buttons, only that they use an external image.

    And FYI: There doesn’t need to be an onclick event handler (or any event handler) in the HTML to invoke a JavaScript function. Actually the best way is to keep scripts out of the HTML and invoke them from an external file, using the DOM to access/address elements.

  • #3
    New Coder
    Join Date
    Sep 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    Inputs of type image are the same as submit buttons, only that they use an external image.

    And FYI: There doesn’t need to be an onclick event handler (or any event handler) in the HTML to invoke a JavaScript function. Actually the best way is to keep scripts out of the HTML and invoke them from an external file, using the DOM to access/address elements.
    Ah... yes! Thanks!
    For the "keep scripts out of the HTML..." issue, do you mean put all scripts into a "xxxxx.js" file and include it in HTML file like this: <script src="xxxxx.js">?

  • #4
    Regular Coder PremiumBlend's Avatar
    Join Date
    Apr 2006
    Location
    Marion, Iowa
    Posts
    201
    Thanks
    0
    Thanked 13 Times in 13 Posts
    I think he means like this:

    Code:
    someElement.onclick = function() {
       alert('You clicked me!');
    }
    My Website: DumpsterDoggy

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by PremiumBlend View Post
    I think he means like this:

    Code:
    someElement.onclick = function() {
       alert('You clicked me!');
    }

    or better still use event listeners for JavaScript and attachEvent for JScript instead of using event handlers at all.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    New Coder
    Join Date
    Sep 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by PremiumBlend View Post
    I think he means like this:

    Code:
    someElement.onclick = function() {
       alert('You clicked me!');
    }
    Oh, I see.


  •  

    Posting Permissions

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