J'ai un champ collection_select, et je veux rendre un div visible ou invisible après l'avoir changé, en fonction de la nouvelle valeur.Rails: Rendre un élément div visible/invisible avec onchange après avoir modifié un champ collection_select
J'ai le code ci-dessous pour le champ collection_select, il y a une fonction JS change_div_visibility qui accepte actuellement un nom div mais je veux aussi passer dans la valeur collection_select.
Comment puis-je également envoyer la valeur actuelle du champ collection_select à la fonction change_div_visibility?
<%= collection_select(:entry, :entry_status_id, EntStatus.find_all_draft_or_edit, :status, :en_desc, {}, {:onchange => "change_div_visibility('entry_set_editor')"}) %>
parfait. Je vous remercie! Appréciez l'aide d'un habitant du Japon – nktokyo