Mike, >I'm using the jQuery Field Plus-in v0.7. I'm doing an ajax post to >another page. I was trying to pass all the name/value pairs at one >time but I'm runnilng into a problem. > >My current post data looks like this: >data: >{problemid:frm.problemid.value,problemTitle:frm.problemTitle.value}, > >Using the plug in, I thought I could do something like this: >var mydata = $("#myForm").formHash(); >... >data: {eval(mydata)}, >... > >However, I get the following error in FireBug: >missing : after property id > >My guess is that it's the quotes after the item name as in the >example: >$("#formName").formHash({"name": "Dan G. Switzer, II", "state": >"OH"}); > >Is there another way to do this or do I need to list out each item in >my post?
The formHash() function is return an actual JS object--not a string. The reason you're getting the error is because you're using eval(mydata). Get rid of the eval() function and that should fix your problem. You should be able to do: var mydata = $("#myForm").formHash(); ... data: mydata, -- or -- data: $("#myForm").formHash(), -Dan