Closed alexey closed 6 years ago
I have form with conditional updates and sometimes i need to serialize only one field.
i tried: $('#' + elm_id).serializeJSON(); and $('#edit_user #' + elm_id).serializeJSON(); both wit try by class name too..
$('#' + elm_id).serializeJSON();
$('#edit_user #' + elm_id).serializeJSON();
it works in JS console but not in the code:
var elm = $('#' + elm_id) console.log('ELM', elm); // return jquery object var payload = elm.serializeJSON(); console.log('PAYLOAD', payload); // return {}
above works when i run it manually. this code run on document ready and behind other function
OH ! sorry i was disabling input before reading serializeJSON() :) just moved prop disable after serialize :)
Thank you for great library!
I have form with conditional updates and sometimes i need to serialize only one field.
i tried:
$('#' + elm_id).serializeJSON();
and$('#edit_user #' + elm_id).serializeJSON();
both wit try by class name too..it works in JS console but not in the code:
above works when i run it manually. this code run on document ready and behind other function