Jump to content

IE cannot read $_POST ??


robert_gsfame

Recommended Posts

This is really weird.below is the code

 

<input type="radio" name="rd" onchange="getpost('test1')">

<input type="radio" name="rd" onchange="getpost('test2')">

 

here is the javascript function

 

function getpost(x)

{

document.getElementById("fillthis").value=x;

document.frm1.submit();

}

 

here is frm1

 

<form name="frm1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">

<input type="hidden" name="fillthis" id="fillthis">

</form>

 

 

here is my php code:

 

<?php

 

if(!empty($_POST['fillthis']))

{

  echo $_POST['fillthis'];

}

 

?>

 

The problem i had is that i can only get the $_POST['fillthis'] result in FF and GOOGLE CHROME but not in IE

 

can anyone help me with this? thx

Link to comment
Share on other sites

Actually, it kind of works in IE, when you un-select one or select the opposite, you get the value from the other one to be sent.

 

The problem is because when you click one radio the other one becomes un-selected and both fire the onchange event.

 

See the JPnyc 08-24-2005, 12:51 PM post at the following link for how you would need to test which radio button became the selected one and only set the value for that one and submit the form for the radio that became set, not the one that became unset -  http://www.phpbuilder.com/board/archive/index.php/t-10307334.html

Link to comment
Share on other sites

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.