Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.