• Resolved miniCarl

    (@minicarl)


    I have created a widget with a select that lets the user choose a post.
    When the save button is pressed tho, all the <option> elements seem to disappear. The change is saved, but i have to reload the page to see it.

    Here’s a video demonstrating the issue:
    http://www.screenr.com/YhLs

    And here’s my plugin for you to download:
    The code for the <select> is located in mod6.php lines 111-124.
    select-widget-zip

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter miniCarl

    (@minicarl)

    Still looking for a solution on this one

    You’re self-closing the select tag, here..

    <select class="widefat" id="'.$field_id.'" name="'.$field_name.'" />';

    Which is causing the select to close premature when it tries to re-render..

    It should read..

    <select class="widefat" id="'.$field_id.'" name="'.$field_name.'">';

    Tags that have a closing element(li,ul,select,option…etc..), shouldn’t be self-closed, the only elements that need to be self-closed are hr, br and img.. (possibly might be one or two more, but they’re the common ones)..

    Thread Starter miniCarl

    (@minicarl)

    Issue resolved, thank you Mark.

    You’re welcome, and thanks for posting back to let us know.. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Buggy select dropdown in widget’ is closed to new replies.