开发者

Jquery form plugin in ASP.NET single form issue, anyway to limit the inputs being serialized to a specific set?

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 formDa开发者_如何学Pythonta 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);


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜