Try this: var securityCheck = "mysecuritycode"; var formData = $("#myForm").formToArray(); formData.push( { name: "security", value: securityCheck }); ... // replace "security" with whatever the correct "name" is.
On 3/23/07, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote: > Hi there, > > I am using the form plugin to serialize my form fields and post them to > a php file. It's working fine, but I need to add a variable added to the > serialized object and/or array, that I use to prevent spamming (a > security variable that is not printed in the html code). > > So I have the following: > > var securityCheck = "mysecuritycode"; > var formData = $("#myForm").formToArray(); > $.post('postentry.php',formData,function(txt) { > blah; > }); > > How do I add the variable securityCheck to the array now? How does it > have to look like? > > Thanks in advance, > > Arne > > -- > Cheers > > Arne-Kolja Bachstein > http://www.arnekolja.com > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/