Results 1 to 6 of 6

Thread: Form with image as button

  1. #1

    Thread Starter
    Lively Member mattalexx's Avatar
    Join Date
    Mar 2002
    Location
    Gloucester, MA
    Posts
    77

    Form with image as button

    Why is my form:
    Code:
    <form name="helpupd" method="post" action="admin.asp?tblname=tblNewBooks&page=1">
    not working when I use an image submit button?:
    Code:
    <input type="submit" name="updhelp" src="images/sq_less.gif">
    The form works perfectly when I use a regular submit button instead:
    Code:
    <input type="submit" name="updhelp">
    Here's the whole form (the version with an image that's not working):
    Code:
    <form name="helpupd" method="post" action="admin.asp?tblname=tblNewBooks&page=1">
            <input type="hidden" name="dishelp" value="0">
            <input type="submit" name="updhelp" src="images/sq_less.gif">
    </form>
    Thanks guys.
    Matt Alexander
    [email protected]

    Don't click here.

    Odigo: 5408962
    AIM: mattalexx
    ICQ: 138006220

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    try this:

    Code:
    <input type="image" name="updhelp" src="images/sq_less.gif" onClick="submit();">
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Lively Member mattalexx's Avatar
    Join Date
    Mar 2002
    Location
    Gloucester, MA
    Posts
    77
    No cigar. I think that kind of thing requires a JavaScript function or something, right?
    Matt Alexander
    [email protected]

    Don't click here.

    Odigo: 5408962
    AIM: mattalexx
    ICQ: 138006220

  4. #4
    Stiletto
    Guest
    Originally posted by mattalexx
    No cigar. I think that kind of thing requires a JavaScript function or something, right?
    You need to add a function. This function is known to javascript.
    The code will submit the form when you clickin the image button.

  5. #5
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    This doesnt work?

    Code:
    <input type="image" name="updhelp" src="images/sq_less.gif" onClick="document.forms('helpupd').submit();">
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  6. #6
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    oh yeah, I didnt see that. I tend to use square brackets BUT if you use document.all it only appears to work with ().
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

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



Click Here to Expand Forum to Full Width