I'm trying to set the selected value of my Jquery select dropdown into a hidden form field. I've got as far as fetching the selected value, but it just sets the hidden value to OBJECT OBJECT.
Do I need to convert it to a string or something first ?
I'm using this plugin: http://designwithpc.com/Plugins/ddSlick
And this is my code:
var ddBasic = [
{ text: "House", value: "house", },
{ text: "Condominium", value: "condo", },
{ text: "Office", value: "office", }
];
$('#propertytype').ddslick({
data: ddBasic,
selectText: "Select a property type",
showSelectedHTML : false,
onSelected: function(selectedData){
$("#property_type").val(selectedData);
}
});
var ddBasic2 = [
{ text: "Rent", value: "rent", },
{ text: "Buy", value: "buy", }
];
$('#acquiring').ddslick({
data: ddBasic2,
selectText: "Do you want to buy or rent ?",
showSelectedHTML : false,
onSelected: function(selectedData){
$("#acquire_type").val(selectedData);
}
});