I have the following Javascript:
var paymentForm = $('#payment_form, .payment-invoices-container');
var ocodes = paymentForm.find('[name="ocodes"]:enabled');
alert(ocodes);
$.post( 'https://URL/ajax-json.do?ocode='+ocodes+'&ocodes='+ocodes, function( data ) {
if (data.hasOwnProperty('dynamicJavascriptUrl')) {
var script = document.createElement('script');
script.src = data.dynamicJavascriptUrl;
$('#credit_card').append($(script));
}
}, "json");
What I want to do is, to take the values from [name="ocodes"] in #payment-form and append it to my $post url but it doesnt seem to get the value because it returns [object Object ].
Can anyone point me in the right direction or give a hint as to what is wrong I would appreciate it :)