I know how to serialize the whole form like in example below or one specific field of the form by just changing the line:
data: $('form').serialize(),
to
data: $('#input-field').serialize(),
.
$(document).on('input paste', '#soap', function () { $.ajax({ type:'POST', url:'/soap', headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: $('form').serialize(), success:function(data){ $('input[id=msg]').val(data.msg); } }); });
But i want to serialize 2 input fields that have an id....how to do that?
$.param()