SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Submit Picture

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit Picture

    Hey, I have a submit button on my forms and I want to get rid of the "blah" looking grey button, so....

    <INPUT TYPE="image" SRC="Whatever.gif" HEIGHT="24" WIDTH="129" BORDER=0 ALT="Submit">

    I noticed that under type, it is image, not submit. Will this still act exactly the same as a normal submit button, or will it just be a dud button with a picture

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will act the same as a normal Submit button, provided it is between the <form> and </form> tags for the form in question.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Except for the fact that you can longer use

    PHP Code:
    if($submit) { 
    You will need to check the coordinates of where the user clicked the image. They are passed as whatever you name the image input plus _x and _y so the when the user clicks the image it passes in your case $submit_x and $submit_y.

    Your image tag, with my additional name attribute which must be present
    <INPUT TYPE="image" NAME="submit" SRC="Whatever.gif" HEIGHT="24" WIDTH="129" BORDER=0 ALT="Submit">

    PHP Code:
    <?

    if($submit_x 0) {
        print 
    "The image has been clicked";
        }
    else {
        print 
    "The image has not been clicked";
        }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
        <title>Untitled</title>
    </head>

    <body>
    <form action="<?=$PHP_SELF?>" method="post">
    <input type="image" name="submit" src="circ.gif">
    </form>

    </body>
    </html>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way I can get an image for a text box


Bookmarks

Posting Permissions

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