Multiple Select Options same validation
I have multiple select options but same validation - alert to say "Please
select an option"
It works this way. http://jsfiddle.net/19eggs/p8j2v/5/ Is there a way to
shorten this ? I was thinking along these lines but I am going wrong
somewhere..;o(( Can you help please ?
function select_option() {
if ($("#european")[0].selectedIndex <= 0 ||
$("#japanese")[0].selectedIndex <= 0 || $("#american")[0].selectedIndex
<= 0 {
alert("Please choose a car");
} ;
$("#assign-euro").live("click",select_option);
$("#assign-jpn").live("click",select_option);
$("#assign-american").live("click",select_option);
No comments:
Post a Comment