I've been trying to get this to work for hours now.
I'm trying to get each input with .textinputclass, combine them together and via ajax putting that into a database.
Two tings are working seperate, I can get each input and put those together in the format that i want.
and I can use .post to send data to a php script to put it in the database
$(".addSubmit").click(function(){ $('.textinputclass').each(function(){ var textData = $(this).val(); var thisLanguage = $(this).attr('id'); var textData = '[:' + thisLanguage + ']' + textData; languagearray.push(textData); }); var nameData = 'test1111'; var textData = languagearray.join(''); var languagearray = []; var data = { 'name' : nameData, 'text' : textData }; $.post('../wp-content/plugins/qtranslate-hardcodedtext/additem.php', data, function() { alert('done!'); }); }); if I remove the .each function and just put text in the data array then the .post works.
whenwon't help.eachloop is in place? The use ofpostis probably a red herring - most likely the loop simply isn't creating the values you think it is.