ASP.NET单一形式问题中的Jquery表单插件,无论如何要限制被序列化为特定集的输入?(Jquery form plugin in ASP.NET single form issue, anywa

编程入门 行业动态 更新时间:2024-10-21 23:11:27
ASP.NET单一形式问题中的Jquery表单插件,无论如何要限制被序列化为特定集的输入?(Jquery form plugin in ASP.NET single form issue, anyway to limit the inputs being serialized to a specific set?)

刚刚在ASP.NET页面上实现了JQuery表单插件,这就是问题所在:

我有一个Form标签(继承自母版页)

表单插件完全取决于连接的“表单”字段

我试图将一个简单的“div”连接到ajaxSubmit但是它没有工作,因为formData通过form.elements循环,所以我必须传递页面的形式...

那么什么会节省一天并允许我使用表单插件是一种方法将上下文传递给插件,它选择输入表单我告诉它通过

主要原因是我有多个保存按钮(实际上没有一个是提交按钮,只是“保存”请求时出现的链接以保存部分表单)

var options = { url: 'template.aspx', type: 'POST', dataType: "html", data: { "iPageId": 1, "iModeId": "save"}, // here is where I want to pass all inputs success: function (responseText, statusText, xhr, $form) { // got responseText correctly }, beforeSubmit: function (formData, jqForm, options) { // I wish there is a way to tell the plugin not to look outside a specific set of the page } }; $myMainForm.ajaxSubmit(options);

Just implemented the JQuery form plugin on an ASP.NET page, and here is the problem:

I have one Form tag (inherited from the master page)

Form plugin depends entirely on a "form" field being wired up

I tried to wire a simple "div" to the ajaxSubmit but it didnt work since formData looped thru form.elements, so I must pass the form of the page...

So what would save the day and allow me to use the form plugin is a way to pass a context to the plugin that it selects the input forms i tell it to pass

the major reason for that is that i have multiple save buttons (none of them is a submit button actually, just "save" links that appear on request to save part of the form)

var options = { url: 'template.aspx', type: 'POST', dataType: "html", data: { "iPageId": 1, "iModeId": "save"}, // here is where I want to pass all inputs success: function (responseText, statusText, xhr, $form) { // got responseText correctly }, beforeSubmit: function (formData, jqForm, options) { // I wish there is a way to tell the plugin not to look outside a specific set of the page } }; $myMainForm.ajaxSubmit(options);

最满意答案

嗯,没有答案所以我会接受我的工作,我只是设置“sematic = true”来强制getElementsbyTagName而不是form.elements

PS,我通过在运行时通过jquery在我想要单独提交的元素周围注入表单标签来解决单个表单

hmm, no answers so i will accept my work around, I'll just set "sematic=true" to force a getElementsbyTagName instead of form.elements

PS, i worked around the single form by injecting form tags on runtime via jquery around the elements i want to submit individually

更多推荐

form,电脑培训,计算机培训,IT培训"/> <meta name="description" conten

本文发布于:2023-08-07 10:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463778.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   序列   无论如何   插件   形式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!