Jump to content

image type button not working in IE???


chanchelkumar

Recommended Posts

Hi dudes,

 

I am working with a form which is having four button images, having the same name.

But the the values are different, i want the values to redirect the page from the action page.

Now the problem is the button value is not getting in the action page of IE...

 

No problem in Firefox...

 

Any idea about this error!!!!!

 

Please help me.....

 

<table width="100%" height="34" border="0" cellpadding="0" cellspacing="0" class="subtitle1">
			<tr>
 				<td width="7%" height="34" align="left" valign="middle">select</td>
 				<td width="3%" align="left"> 
   					<input type="checkbox" name="checkall" value="checkall" id="checkall" disabled="disabled" ></td>

		        <td width="2%" valign="middle" align="left">to</td>
				<td width="14%" align="right">
				<!--a href="contactuser.php?es_type=1"-->
  					<input type="image" src="images/content_tabs_1.gif"  border="0"   name="con_submit" value="Contact Now" id="con_submit"/></td>
				<td width="2%" valign="middle" align="center">or</td>
				<td width="72%" align="left">
  						<input type="image" src="images/content_tabs_2.gif" border="0"  id="con_submit" name="con_submit" value="basket"  /></td>
  				
			</tr>
  		</table>

 

In this code there is only two buttons, but another pair is also in my page with the same code....

 

Am getting the value in the action page as

 

$_request['con_submit'];

 

By the value of the button i want o redirect the page...

 

Please help me...

 

Link to comment
https://forums.phpfreaks.com/topic/80584-image-type-button-not-working-in-ie/
Share on other sites

Okkk

 

<form name="massInquiry" id="massInquiry" action="masscart.php" method="post">
<table width="100%" class="subtitle1">
   <tr>
<td width="5%" valign="middle" align="left">
 select</td>
<td width="3%" align="left"> 
  <input type="checkbox" name="check_all" value="checkall" id="check_all" disabled="disabled">

<!--<input type="checkbox" name="checker[]" id="checker[]" value="<? //echo $offer['es_id']?>">	-->				 
</td>
<td width="2%" valign="middle" align="left">to</td>
<td width="12%" align="right"><!--a href="contactuser.php?es_type=1"-->
  					<input type="image" src="images/content_tabs_1.gif" border="0"  id="con_submit" value="contact"/></td>
<td width="2%" valign="middle" align="left">or</td>
<td width="76%" align="left">
    <input type="image" src="images/content_tabs_2.gif" border="0" id="con_submit" name="con_submit" value="basket" /></td>
   </tr>
  </table>
  </form>

 

 

And my php code

 

 

<?php
include_once('myconnect.php');

if( !isset($_REQUEST["browse"]) ||($_REQUEST["browse"]==""))
{
header("Location: gen_confirm.php?errmsg=".urlencode("Invalid access, denied"));
die();
}

$browse=$_REQUEST["browse"];
  $chck_cnt=$_REQUEST["cnt"];
  $buttonvalue=$_REQUEST["con_submit"];

$browse.$chck_cnt;
//die();
//for($i=0;$i<$chck_cnt;$i++) echo $_REQUEST["check_".$i];
//die();
include_once "logincheck.php";

if ($buttonvalue=='basket')
{

header("Location:"."cart_items.php");
die();
}
else if($buttonvalue=='contact')
{
header("Location:"."inquire_all.php");
die();
}

//=======================maintaining cart items=======================================
?>

Try like this

 

<?php 

$browse=$_REQUEST["browse"];
$chck_cnt=$_REQUEST["cnt"];
$buttonvalue=$_REQUEST["con_submit"];

if($_SERVER['REQUEST_METHOD'] == 'POST') 
{
switch ($buttonvalue) 
{
case "basket":
header("Location:"."cart_items.php");
break;
case "contact":
header("Location:"."inquire_all.php");
break;
}
}
?>

Then you can do one thing

<?php 
// after you press the button 
if($_SERVER['REQUEST_METHOD'] == 'POST') 
{
// get the button value here 
$browse=$_REQUEST["browse"];
$chck_cnt=$_REQUEST["cnt"];
$buttonvalue=$_REQUEST["con_submit"];
// and proceed with your redirect stuff

?>

 

When I used Image field as button, it didn't work in IE until I used $_SERVER['REQUEST_METHOD'] == 'POST'

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.