Reputation: 334
I have a dropdown in which there is a include_blank: "Select city"
. I want to write a code in which any city(excluding "Select city") is selected I want to disable
some fields. But How can I check that any city is selected not message
is selected.
<%= f.select 'city_id', grouped_options_for_select(cities), :include_blank: "Select city" , id: nil %>
Thanks in advance.
Upvotes: 0
Views: 36
Reputation: 1044
If($("#city").val() == ""){
console.log("");
}else{
// your code
}
Upvotes: 1