i have a select box where in it has a list of items and he enters value for each selected option and saves it . i have written a function like.
$('.add_recordings').click(function () {
if (($('#recordings_name').val() != '') && ($('#recordings_value').val() != '')) {
if ($('#recordings').val() == '') {
var result = $('#recordings_name').val() + '=' + $('#recordings_value').val();
$('#recordings').html(result);
var result1 = $('#recordings_name').val() + '=>' + $('#recordings_value').val();
$('#recordings_array').val(result1);
}
else {
var result = ', ' + $('#recordings_name').val() + '=' + $('#recordings_value').val();
$('#recordings').append(result);
var result1 = ', ' + $('#recordings_name').val() + '=>' + $('#recordings_value').val();
alert(result1);
$('#recordings_array').append(result1);
}
}
});
the append function for recordings_array is not working, its a input of type text.
what i am trying to do is to build an php array using jquery ,so that it can be passed in $_POST.. is there any better method to do this?