How can I send multiple value for a form element when posting data through ajax ?
I am creating a search form using ajax, I've a field for Bedrooms and I've used radio buttons as Double, Single and Both. The only problems lies with selection 'Both' which gives no positive result. The 'Both' actually is not a value but I want to fetch Bedrooms of both Double and Single Type.
I wrote following code on change event of radio button.
-
var $form = $("#frm1");
url = $form.attr( 'action' );
formdata = $form.serialize();
formdata = $form.serializeArray();
formdata = $.grep(formdata,function(o,i){ return o.value != 'Both'; });
formdata = formdata + "&CAT_Custom_228468=Double&CAT_Custom_228468=Single";
formdata = $.param(formdata);
$.post( url, $.param(formdata),
function( data ) {
$( "#results").html("");
$("#loader").hide();
$( "#results" ).empty().append( $(data).find("#results").html());
});
Can you guys tell me how can I fetch Bedrooms for both type ?