Input type Image not working in Firefox


Hello Friends,

I am PHP Developer and my web designer gives me HTML pages in which submit button placed with input type image. Obviously input button needs to show image instead of text and can not be done with CSS as its fancy fonts so web designer makes it in image and put it with input type image.

When i code in that page, when i press on that input type image button to submit form in firefox, it was giving me x and y coordinates for the input type image button. Below is the code.

<input type="image" name="btn_submit" src="path/images/submitbg.png" />

I was expecting to get $_POST[‘btn_submit’] value to process the form data with database. Instead of $_POST[‘btn_submit’], I am getting $_POST[‘btn_submit.x’] and $_POST[‘btn_submit.y’] in firefox while $_POST[‘btn_submit’] is working in Crome and other browsers.

To make it work with all browsers, you need to change the input type image to input type submit and give the image in background of input type button. Here is the code.

<input style="background: url('path/images/submitbg.png');" type="submit" name="btn_submit" value="" />

Above will work in all browsers. I hope this helps you. :)

About Rakshit Patel
I am PHP Freelancer, Rakshit Patel AKA WordPress Freelancer working as PHP Programmer India. I am here to share all my developing knowledge, quick coding techniques, quick solutions to save your time and help you guys for any issue or bug fixing. If you have any PHP, WordPress, Magento related work, please contact me. I am interested for the work.

 • Linkedin • Youtube • Flickr • Instagram • 

1 Comments on Input type Image not working in Firefox

  • Tom Miller
    July 26, 2013 at 8:58 am

    Why are you looking for $_POST[‘btn_submit’] in the first place? I have always used a hidden field to trigger the form processing due to an over sight in I.E..

Leave a Reply

Your email address will not be published. Required fields are marked *




DHgate Computers - Computers, Cell Phones & more
  • We find everbuying built in php and use css to control the style.

About Author

PHP Freelancer

PHP Freelancer I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I am here to share all my developing knowledge with you people. For Hire PHP Developer India, contact me.
Follow on twitter: @raxit4u2

Get Free Programming Tutorials:

Become a Fan

Popular Topics

Recent Posts

Most Popular

Recent Comments

Get a Free Quote
Security Question: 3 + 8 = ?