Quicker Solution To Submitting Forms With Hidden Fields Using JQuery

Quicker Solution To Submitting Forms With Hidden Fields Using JQuery

purespoopurespoo Posts: 1Questions: 0Answers: 0
edited August 2013 in Bug reports
I recently noticed a previous blog that mentioned painstaking methods of submitting form elements from hidden fields.
http://www.datatables.net/forums/discussion/185/submitting-forms-with-fields-on-hidden-pages/p1

Granted that blog was about 3 years old. I just wanted to offer a newer revised solution to this rather than the painstaking methods contributed in the blog.

The solution came to me upon reading another blog on how to check dataTables checkboxes if they weren't displayed in the dom.

While doing this for work I had to ajax form fields using javascript so a generalized answer is below.

jQuery('#form_id').on("submit", function () {

//this successfully merges most form elements relative to functionality of serializeArray
var data = jQuery.merge( jQuery('#form_id').serializeArray(), jQuery('input:checked', oTable.fnGetNodes()).serializeArray());

}
This discussion has been closed.