...

View Full Version : Submit button not working when used as image? (PHP form, IE issue)



jenny_jane
10-21-2009, 10:50 PM
Hello,

I've modified this PHP Tell a Friend script:

http://www.php-learn-it.com/php_scripts/tell_a_friend_script.html

Here is my version:

http://kittentaboo.com/yeskidzcan/tell_a_friend.php

The submit image is not working in Internet Explorer (I'm testing in 7). If I use the standard submit button instead of an image, it works fine. Both versions work fine in Firefox. See this version:

http://kittentaboo.com/yeskidzcan/tell/tell_a_friend.php

Whyyyyy? I'm sure I sound picky, but I think my submit image looks much nicer and I would prefer to use that over the canned button...

Thanks for any input.

jenny_jane
10-21-2009, 11:24 PM
My friend helped me fix this. We were able to find the answer here:

http://www.webmasterworld.com/forum88/4894.htm

Needed to change this line:


if(isset($_POST["submit"]))


To this:


if(isset($_POST["submit"]) || isset($_POST["submit_x"]))

CFMaBiSmAd
10-21-2009, 11:44 PM
All browsers send the submit_x variable for an image button, so you only need to use -


if(isset($_POST["submit_x"]))

jenny_jane
10-21-2009, 11:46 PM
Thanks for the input! :)

kbluhm
10-21-2009, 11:48 PM
It's good to see someone actually inform us -- and future generations -- of the solution after solving the issue on your own. On countless occasions I've seen a member ask a question and after figuring it out two seconds later they totally disregard anyone who may have the same issue in the future and replace the original question with "solved. plz delete this".



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum