$(document).on('click','.locations',function(e){ e.preventDefault(); if(data.length > 1){ $.post('/home/locations',{'locations': JSON.stringify(data)},function(result){ res = JSON.parse(result); if(res['resp'] == 1){ $('.map_id').val(res['map_id']); } });} $('form').submit();}); The request itself. Tried to do prevent (disable submit) but the data comes after the submission and bd does not get a value with .map_id
stringify? - teran