Jump to content

Image Buttons/Submit not working in IE/Firefox


JasonHarper

Recommended Posts

Hello,

I'm having a strange problem I can't seem to figure out.  Traditionally in my php apps, I just use the standard html buttons.  However, I've done one recently where I decided to use images as buttons.  However, when a user submits a form using IE or Firefox, nothing happens.  The form appears to post to the server because the fields are cleared but it's like no PHP code is executing.  The page works fine in Chrome or Safari.  Any idea how I can go about troubleshooting this?

 

Thank you!!!

Jason

 

<input type="image" src="/images/button_submit.gif" name="Submit" value="Submit" alt="Submit" />

or do:

<input type="submit" name="Submit" value="Submit"  />

 

and in css

 

input[type=submit]{
   border:none;
   background: url(../images/button_submit.gif) no-repeat;
   /* make sure you set some dimensions */
}

When you use an image as the submit button the webbrowsers submit the x and y co-cordinates of the cursor where the user clicked on the button. Doing a print_r on $_POST you'd see this

Array
(
    [submit_x] => 0
    [submit_y] => 0
)

 

If you used a normal submit button (<input type="submit" name="Submit" value="Submit"  />) you'd see this outputted

Array
(
    [submit] => submit
)

 

Notice how the name of submit button changes. This is what I meant by checking to see if submit_x or submit_y exists when using an image as the submit button.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.