English 中文(简体)
表格上的子吨以IE7表示外部形式
原标题:Submit button on nested form submits the outer form in IE7

我有以下法典:

  <form id="frmJump" method="post" action="Views/ViewsHome.aspx">
    <input name="JumpProject" /><input type="submit" value="Go" />
  </form>

然而,当我点击“Go”纽芬兰时,该页站又回家,而不是去见Home.aspx。

我甚至试图增加一些文字,强迫提交表格:

<input name="JumpProject" onkeypress="if(event.keyCode == 13) { this.form.submit(); return false; }" />

但是,即使我发布ENTER,家事页也重新上载。

我可以看到,唯一可能流产的是,这种形式实际上是一种儿童形式,是儿童协会的主要形式。 NET注入网页。

我确信,我有点 missing的失踪Im,这一职位将立即使800名下台的人把我带回到N00b广场,但也许我 t太晚地睡觉,我一米没有 something。

This is on IE7 and an ASP.NET 4.0 backend. I also have jQuery libraries loaded on the page incase jQuery can improve this somehow. Thanks!

最佳回答

The most simple explanation is that forms cannot be nested.

您可考虑修订您的提交逻辑,以适当处理假想服务器方面(通过单一后退表格)。 否则,你可能不得不考虑一条偏离标准的伙伴关系。 NET Webforms postback model.

问题回答

You can t nest forms in HTML, so the browser will ignore the inner form tag. When you submit the form, it will submit the only form that is on the page.

If you need to post a form to a different page, you can use Javascript to either change the current form before it s sent (onclick on the button), or create a new form element, add it to the page and submit that instead.

您不再允许以超文本形式填写。 它没有得到大多数浏览者的支持。

你们可以做些什么,因为你通过网络信息再次遭受痛苦,只是要有一个布顿。 C#的浮标活动,与提交纽特人重新点击,并且该项目从那里跳出。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签