www.webdeveloper.com
Results 1 to 13 of 13

Thread: image button in submit-input?

  1. #1
    Join Date
    Nov 2005
    Posts
    187

    image button in submit-input?

    Hi I'm using the following line to submit a form data.

    <input type="submit" value="Submit the Request"/>

    My question is how can I place an image of a button instead of the regular button, and how to program that when someone is pressing the image the form variables are still being passed to the next page?

    How can I do it?
    Thanks in advanced, Oz.

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Apr 2006
    Posts
    93
    Quote Originally Posted by ozpo1
    Hi I'm using the following line to submit a form data.

    <input type="submit" value="Submit the Request"/>

    My question is how can I place an image of a button instead of the regular button, and how to program that when someone is pressing the image the form variables are still being passed to the next page?

    How can I do it?
    Thanks in advanced, Oz.
    use this:
    <input type="image" src="yourfile.gif"/>
    Get Opera

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Quote Originally Posted by Little Goat
    use this:
    <input type="image" src="yourfile.gif"/>
    Actually, that's wrong. See my post above.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Quote Originally Posted by Charles
    Actually, that's wrong. See my post above.
    Is it? Why?

  6. #6
    Join Date
    Apr 2006
    Posts
    93

    Exclamation no, it's not

    Quote Originally Posted by Charles
    Actually, that's wrong. See my post above.
    what do you mean wrong? your second link has a section on images, and if your only using it for a submit button, it should work fine.
    LG
    Get Opera

  7. #7
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    You'll find that it doesn't validate. Follow the links that I provided.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  8. #8
    Join Date
    Apr 2006
    Posts
    93
    well, I don't see anything that says that, but oh well..
    LG
    Get Opera

  9. #9
    Join Date
    Dec 2004
    Posts
    8,637
    Quote Originally Posted by Charles
    You'll find that it doesn't validate.
    I don't know what you mean. The following goes through what I would call normal validation in both IE and Mozilla (and at the W3C validator). I know there are other browsers, but perhaps you'd care to elucidate.
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                          "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Submit Image</title>
    </head>
    <body>
    <form action="" onsubmit="alert('validating'); return false;">
    <p><input type="image" src="../images/SubmitA.gif"
     alt="Submit Form" style="width:136px; height:48px;"></p>
    </form>
    </body>
    </html>

  10. #10
    Join Date
    Dec 2004
    Posts
    8,637
    Quote Originally Posted by Nedals
    Is it? Why?
    Quote Originally Posted by Little Goat
    what do you mean wrong?
    Probably just because it is missing an alternate text specification -- but, apparently, a lack of common courtesy forbade such a simple answer to our questions.

  11. #11
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Quote Originally Posted by phpnovice
    Probably just because it is missing an alternate text specification -- but, apparently, a lack of common courtesy forbade such a simple answer to our questions.
    Charles' answers are always accurate, but somtimes not as helpful as they could be. I, like many others, don't really want to wade though technocratic (is that a word?) documentation.

  12. #12
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Quote Originally Posted by Nedals
    I, like many others, don't really want to wade though technocratic (is that a word?) documentation.
    Don't blame me for refusing to cater to your sloth.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  13. #13
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Quote Originally Posted by Charles
    Don't blame me for refusing to cater to your sloth.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles