I have a serializeArray in my form to send the data via post with ajax, but I wanted to get a data that is in a hidden field in the form to use before the post, in the same javascript, how can I recover?
// setup some local variables
var $form = $(this);
// Let's select and cache all the fields
var $inputs = $form.find("input, select, button, textarea");
// Serialize the data in the form
var serializedData = $form.serializeArray();
// Atualmente faço assim
//
var codigo = "";
if($('#code').val()){
codigo = $("#code").val();