robert_gsfame Posted October 28, 2010 Share Posted October 28, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/217106-ie-cannot-read-_post/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 28, 2010 Share Posted October 28, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/217106-ie-cannot-read-_post/#findComment-1127596 Share on other sites More sharing options...
robert_gsfame Posted October 28, 2010 Author Share Posted October 28, 2010 yupp! your explanation is so helpful...when i try to change the onchange into onclick. I can easily solve the problem. Thx a lot PFMaBiSmAd !! Quote Link to comment https://forums.phpfreaks.com/topic/217106-ie-cannot-read-_post/#findComment-1127601 Share on other sites More sharing options...
PFMaBiSmAd Posted October 28, 2010 Share Posted October 28, 2010 Or you can just do that ^^^ (onclick) Quote Link to comment https://forums.phpfreaks.com/topic/217106-ie-cannot-read-_post/#findComment-1127604 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.