I'm hoping someone on this site can offer some help. I have a page that uses ajax to load a form (id: "editform") into a jQuery-ui dialog box. The dialog box has a button attached - when someone changes the form and clicks this button it triggers a function which serialize()
s the form data and sends it via $.post
to replace a div on the page with the results. This works fine in every browser I've tested on except...wait for it...IE (all versions). The problem seems to be that IE is not recognizing the call to serialize this form.
alert($("#editform").serialize());
gives me "" in IE, but the desired long querystring in other browsers. I've also tried to grab the data one piece at a time,
alert($("#name").val());
Again - IE does not recognize this field, returning "" while the other browsers output the data开发者_运维知识库 I'm looking for.
Any ideas?
Thanks
Okay - I found it. Thanks, Brandon H. for pointing me to the HTML - I hadn't closed the form () in the generated HTML, which was apparently tripping up IE. I got it up and running now.
Thanks all for your time.
Is this a typo in here, or also in your code:
alert($("#editform").serialize();
See the missing )
. It should be:
alert($("#editform").serialize());
精彩评论