Admin menu bar dropdown opens when I click on a form element (Chrome) [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years … Read more

Get index of selected option with jQuery

I’m a little bit confused about how to get an index of a selected option from a HTML <select> item. On this page there are two methods described. However, both are always returning -1. Here is my jQuery code: $(document).ready(function(){ $(“#dropDownMenuKategorie”).change(function(){ alert($(“#dropDownMenuKategorie option:selected”).index()); alert($(“select[name=”dropDownMenuKategorie”] option:selected”).index()); }); }); and in html (…) <select id=”dropDownMenuKategorie”> <option value=”gastronomie”>Gastronomie</option> … Read more

Custom widget select options needs to stay selected after save

I am working on a custom widget that includes a select options drop-down list of pages. When I select a page and save, the selected option does not stay selected. However, if I refresh the widgets page, the selected option (page) does show as selected. class slideshow_widget extends WP_Widget { // Main constructor public function … Read more

How to dynamically save a selected option from page “Templates” selectbox?

When I select a template for a page from the “Templates” selectbox, the selected item gets “value=selected” only after I hit save draft/publish/update. <option value=”template-gallery.php” selected=’selected’>Gallery</option> How can the option receive the value “selected” without the need of save/publish/update hit button? (like on widgets page: they get saved without page refresh) Thank you! 1 Answer … Read more