I have an onclick event on all forms on the page:
$('form[method="post"]').click(function() {
if($('textarea[name="serialized_data"]').length > 0) {
alert("serialize_data already exists in this form!");
return false;
}
var data=$(this).serialize();
$(this).append('<textarea name="serialized_data">'+(data)+'</textarea>');
});
If you press a submitbutton and then on the target page press back in the browser, then this alert comes up.
But this solution stops on all forms.
How can I apply the alert only on the form that submitbutton was already pressed?
If you wonder why I input all data in that textarea, that is another question: compact all form-data with javascript