IE8 does not submit hidden input in form

不打扰是莪最后的温柔 提交于 2019-12-12 18:34:56

问题


I found this form in a project and it works fine in Chrome but not in Internet Explorer. IE8 does submit the form as POST but does not send the hidden input:

    <form name="logout_frm" id="logout" action="index.php" method="post">
        <label>Logout</label>
        <input type="hidden" name="logout" value="1" />
        <input type="submit" name="logoutBtn" value="logout" />
    </form>

This is the raw data I get from fiddle2 also WebForms Tab is empty:

POST https://example.com/index.php HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
Referer: https://hostname.net/index.php
Accept-Language: de-DE
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: hostname.net
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: GUEST_LANGUAGE_ID=en_US; COOKIE_SUPPORT=true; ntlm=1; PHPSESSID=28b0fbgol5bnq56qqst423p80ota470sqclbnpc4p5egqqdbt4tw
Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAAAbEdAAAAAA==

Update

If I clear the cache and reload the page it works one time but only once. Maybe this is somehow related to the NTLM login Authorization: NTLM.


回答1:


You have duplicated the logout name. Rename the hidden field or the form.




回答2:


After I noticed it is something about caching simply disabled it and now it works:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

This is not really an answer as it does not explain what is doing on here but it is a workaround.



来源:https://stackoverflow.com/questions/22962388/ie8-does-not-submit-hidden-input-in-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!