Hi,
Trying to send postdata thru ajax
The code tried so far,
var $inputs = $('#myform :input');
var values = {};
$inputs.each(function(i,field) {
if($(this).is(':text'))
{
//alert("id : " + field.id + " value : "+ field.value);
values[field.id] = field.value
}
if($(this).is(":radio"))
{
var v = $(this).attr('checked')
if (v == true)
{
values[this.name] = $(this).val()
//alert($(this).attr('checked'))
}
}
if($(this).is(":checkbox"))
{
var v = $(this).attr('checked')
if (v == true)
{
values[this.name] = $(this).val()
//alert($(this).attr('checked'))
}
}
alert($(this).is(":hidden"))
if($(this).is(":hidden"))
{
values[field.name] = field.value
}
//alert("dropdownlist : " + $(this).is('option:selected'));
//values[field.id] = field.value
});
It works fine, but i want to determine
whether dropdownlist is selected or not based
on it I need to add values[field.id] = field.value
Is there any way to find out about dropdownlist
Similar to $(this).is(':checkbox'),$(this).is(':text')
Any help will be valuable