groups_from_collection_for_select selector

12 views
Skip to first unread message

Dave Castellano

unread,
Jun 28, 2013, 6:31:59 PM6/28/13
to rubyonra...@googlegroups.com
Hi all,

Anybody know what the jQuery selector is for the "selected" value of a
option_groups_from_collection_for_select

I'm trying to listen for a button click and then determine whether the
user has selected an item from a dropdown or not... (not the same
button)

Coffee:
$('.landing_edit_questions_btn').click ->
if $('#minisections').val()??? == "Select an Area"
alert('Select an area!')

erb:
<%= select_tag :minisections,
option_groups_from_collection_for_select(Subsection.order(:title),
:minisections, :title, :id, :title), :prompt => "Select an Area" %>

Any help appreciated!
Thanks DaveC

--
Posted via http://www.ruby-forum.com/.

Tamara Temple

unread,
Jun 28, 2013, 11:53:54 PM6/28/13
to rubyonra...@googlegroups.com
Dave Castellano <li...@ruby-forum.com> wrote:
> Anybody know what the jQuery selector is for the "selected" value of a
> option_groups_from_collection_for_select

Does this help? http://api.jquery.com/selected-selector/

Reply all
Reply to author
Forward
0 new messages