Jump to content

Submit Button Issue IE7


IComic

Recommended Posts

Hey Guys,

 

I have been stuck on this one issue for a few hours, I have been googling for help but no luck, thought I would try my luck here if anyone had any idea.

 

I have a simple form,

 

 

if(isset($HTTP_POST_VARS['ConfirmInfo'])) // tried $_POST as well.

{

    echo "Test";

}

 

 

echo "<form method="POST" action=\"$_SERVER[php_SELF]\">";

echo "<input type=\"text\" name=\"PaymentChoice\" />";

echo "<input type=\"image\" src=\"$FolderDepth/Images/Webs/Cancel.jpg\" value=\"Cancel\" name=\"Cancel\"/>";

echo "<input type=\"image\" src=\"$FolderDepth/Images/Webs/Confirm.jpg\" value=\"Confirm\" name=\"ConfirmInfo\"  />";

echo "</form">;

 

 

 

The problem I am having is, I can submit the form in FireFox, but not in IE what gives? I have noticed when printing out the array of $_POST variables, the button field is not in there. I have tried changing it to just a submit button but no luck either. In FireFox, if I print out the array of $_POST I can see the button field and its value displayed.

 

If I tried this

 

echo $HTTP_POST_VARS['PaymentChoice'];

 

it would print out fine.

 

I didnt display the entire script its is long.

 

Any help ?

 

Thanks.

 

 

Sukh

Link to comment
https://forums.phpfreaks.com/topic/141199-submit-button-issue-ie7/
Share on other sites

<?php
print_r($_POST);

/*
if(isset($_POST['ConfirmInfo'])) // tried $_POST as well.
{
    echo $_POST['ConfirmInfo'];
}
*/
?>
<form method="post" action="<?php echo $_SERVER[php_SELF]; ?>">
<input type="text" name="PaymentChoice" />
<input type="image" src="<?php echo $FolderDepth; ?>"/Images/Webs/Cancel.jpg" value="Cancel" name="Cancel" />
<input type="image" src="<?php echo $FolderDepth; ?>/Images/Webs/Confirm.jpg" value="Confirm" name="ConfirmInfo"  />
</form">

 

you are using an image input - this is handled differently in browsers - print out the entire post array and you will see which browsers report what.  Some will return the x y coordinate of where the image was clicked others just the value...

All browsers report the x,y coordinates and that is what should be used (or just use a hidden field with a value.) Only some browsers send the value="..." parameter.

 

http://www.phpfreaks.com/forums/index.php/topic,233261.msg1084566.html#msg1084566

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.