i have a from with many select tags , when the user submit the form i want to check if the user choose one option for all the select tags and this is my jquery code
$('#apForm select').each(function(){
var $this = $(this);
if ($this.selectedIndex == 0){
var error = 'fill this please' ;
$this.next('span').text(error);
errorCount = errorCount + 1;
}
});
and i tried like this
$this.attr("selectedIndex")
i just give you the piece of my code where my question is
if i should give more code tell me
thank you for help
or just simple
If no
optionit will return-1here I showed all above cases