jquery.form.js sends old form data only page reload helps.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

jquery.form.js sends old form data only page reload helps.

tanteanni
i am using jquery.form.js since a while and never had problems. i am
using only "form.formSerialize();"
within the following function:
 
function sendForm(formid,destination,prefix) {
    var form = jQuery(formid);
    var addstring=form.formSerialize();
    alert(addstring);
    fetch(prefix + addstring,destination, "replace", "event");
}
 
the fetch is a selfmade ajax function.
 
the problem is that for some reason formSerialize serializes an old
form with old data (the first one sent after last reload of the page).
the alert() shows this. but if i look into "generated
source" (webdeveloper toolbar) before sending the form the form has
correct (current values). then i press the button that sends this form
via "sendForm" and the data the alert shows isn't the data from the
form sent, shown in source. it's the old data and this don't changes
'til reload of the page.
there are several kinds of formfields - all are send with the old
data!
 
where the hell "comes" this old data from? where is it chashed? why is
it chashed?
and why this happend never before? i can't see any differences in
usaage now and before?!
 
thx in adv

i got one possible reason for this strange behaviot: the form to be sent isn't present on page load. it is generated and inserted via ajax. jquery seem to serialize it correct but only the first time it is inserted and then jquery ony sends this somehow chached data until the hole site is reloaded. is there a way to say jquery to only reload this form?

another strange thing is, if i sent the form via the normal submit with an action(e.g. "some.php?var1=5&var2=6") defined in form tag. jquery allways deletes all given parameters from action but the site is untouched ->"some.php "+"data from form".