简体   繁体   English

IE6最奇怪的问题是未提交表单

[英]Strangest problem with IE6 not submitting a form

I need expert advice here... 我在这里需要专家的建议...

I have run into the strangest problem in my career... 我遇到了职业中最奇怪的问题。

I have a form with alot of "SELECT" tags. 我有一个带有很多“ SELECT”标签的表单。 Each tag contains a large amount of "OPTION" tags. 每个标签包含大量的“ OPTION”标签。

The form wont submit at all, but when I remove parts of the form content (for example, some SELECT tags), then the form will submit properly. 表单根本不会提交,但是当我删除部分表单内容(例如某些SELECT标记)时,表单将正确提交。

However, there is NO consistency whatsoever, I mean, the removal of the tags can be random. 但是,没有一致性,我的意思是,标签的去除可以是随机的。 I have tried looking at what part exactly of the "removed" part of my form could be causing the form not to submit, but I can't figure it out. 我尝试查看表单中“已删除”部分的确切部分可能导致表单无法提交,但我无法弄清楚。

It is easier explained by showing you an example... I will skip the form tag, and js functions because I am positive they are not the problem now after hours of headache... 通过向您展示一个示例,可以更容易地解释它...我将跳过form标记和js函数,因为我确信在经过数小时的头痛之后它们现在不是问题了...

Here is one SELECT tag: 这是一个SELECT标记:

<div class="nav_sub_juveler" id="nav_sub_juveler">

  <select name="smycken_type" id="smycken_type" style="width: 130px; margin-bottom: 5px;">
                 <option value="Alla Typer" class="nav_option_main" selected>-- Alla Typer --</option>
                 <option value="Klockor & Ur" title="Klockor, Ur">Klockor & Ur</option>
                 <option value="Juveler" title="Smycken, Pärlor, Guld, Silver, Diamanter mm">Juveler</option>
                 <option value="Övrigt" title="Övrigt">Övrigt</option>
  </select>

<br />

      <input type="radio" name="smycken_action" id="smycken_säljes" value="Säljes" checked onClick="disable_actions('nav_sub_juveler', false);">
      <font face="Arial, Helvetica, sans-serif" style="font-size:14px; font-weight:bold;">Säljes</font>
      <input type="radio" name="smycken_action" id="smycken_köpes" value="Köpes" onClick="disable_actions('nav_sub_juveler', true);">
      <font face="Arial, Helvetica, sans-serif" style="font-size:14px; font-weight:bold;">Köpes</font>

</div>

Now, in this part of the form, I have a division container which contains some options (just like the rest of my form). 现在,在表单的这一部分中,我有一个除法容器,其中包含一些选项(就像表单的其余部分一样)。 If I chose to remove the radio buttons here, the form will submit. 如果我选择在此处删除单选按钮,则将提交表单。 So right away, you think "ok, there must be something about the radio buttons causing the form not to submit!". 因此,您马上就想到“好吧,单选按钮上肯定有某些东西导致表单无法提交!”。 But NO! 但不是! If I instead remove the "Options" in the select tag (or the select tag alltogether), but leave the radios, the form will submit again. 如果我改为删除select标记(或全部在一起的select标记)中的“ Options”,而离开收音机,则表单将再次提交。 But leaving both will not submit the form. 但是离开两者都不会提交表格。

And the strange about this is that the rest of the form is made exactly the same way as this, and it WILL submit with both radios and selects... 奇怪的是,表单的其余部分都是用与此完全相同的方式制作的,它将同时通过两个无线电提交并进行选择...

I can't figure it out... 我不知道...

Is there anything you can see here that could cause the problem? 您在这里看到任何可能导致此问题的内容吗?

PS: The css has no problem either, the prob is elsewhere... PS2: I have tried rewriting and rearranging the text, but no luck PS:CSS也没有问题,问题不在其他地方……PS2:我尝试重写并重新排列文本,但是没有运气

If the <form> is using GET , try changing it to POST and see if that makes a difference. 如果<form>使用的是GET ,请尝试将其更改为POST ,看看是否有所不同。

As @spbfox was saying, there's a limit on how long a URL can be. 正如@spbfox所说,URL的长度是有限制的。

Edit 编辑

It's not just IE6, URLs longer than ~2k cause all kinds of breakage. 不只是IE6,超过2k的URL会导致各种损坏。

I had a legacy app which used GET on a huge page (100+ fields), and it worked okay for years...then last winter the user installed a common toolbar (Google, Yahoo or Bing, don't remember which), and it would silently truncate the data. 我有一个旧版应用程序,该应用程序在一个巨大的页面(超过100个字段)上使用GET,并且可以正常使用很多年……然后,去年冬天,用户安装了一个通用工具栏(Google,Yahoo或Bing,不记得是哪个),它将以无提示的方式截断数据。 Changing the page to POST fixed it. 将页面更改为POST可以修复它。

Of course, if your action page uses Request.QueryString() you'll have to change those to Request.Form(). 当然,如果您的操作页面使用Request.QueryString(),则必须将其更改为Request.Form()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM