Submit form using javascript, work in FF but not in IE

Posted by Permana on Stack Overflow See other posts from Stack Overflow or by Permana
Published on 2010-04-22T02:29:10Z Indexed on 2010/04/22 2:33 UTC
Read the original article Hit count: 264

I have this code.

The code below is working in Firefox, but it is not in IE

<body>
<?php
$data = getLoginData($_SESSION['whoyouare']);
?>
    <form name="frm_redirect_dfr" action="<?php echo $data['url']; ?>" method="POST" id="frm_redirect_dfr" style="display: none;">
    <input name="DFRNet_User" value="<?php echo $data['username']; ?>" type="hidden" />
    <input name="DFRNet_Pass" value="<?php echo $data['password']; ?>" type="hidden" />
    <input name="tbllogin" value="login" type="hidden" />
    <input type="submit" value="submit" />
    </form>
    <script language="javascript" type="text/javascript">
    document.forms["frm_redirect_dfr"].submit();
    </script>
</body>

What I want to do is, when user access the page, it first will try to get login data, echo it in the form, and submit the form automatically using javascript

© Stack Overflow or respective owner

Related posts about html

Related posts about JavaScript