Title: Dropdown: Can’t reselect default selection
Last modified: December 6, 2017

---

# Dropdown: Can’t reselect default selection

 *  Resolved [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/)
 * Seems no matter which item in my dropdown I choose as the default selection, 
   I cannot get it to be selected again after I select something else in my dropdown.
   In fact, on my iPhone, I notice I the default selection is ghosted out. Is this
   normal? Is there a way around this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdropdown-cant-reselect-default-selection%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9755056)
 * Hey [@databell96](https://wordpress.org/support/users/databell96/) –
 * Sorry to hear about the issue you’re experiencing. Is this first the current 
   default level “Ben Gurion Hall”… ? I see that it’s disabled.
 * Have you tried switching it from “dropdown” to “radios” in the donation form?
   Also, have you tried quickly switching themes to see if it’s a theme issue. It
   shouldn’t ever disable the default level. I’ve never seen this before so am interested
   to find out what the issue is. Finding out answers to the questions above will
   help me.
 * Thanks
 *  Thread Starter [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9757742)
 * It is the theme. Actually, a custom function I added to make it I believe add
   a Choose your Level as the main selector. Here’s the code that causes the issue:
 *     ```
       /**
        * GiveWP Functions for Donations Form
        */
       add_filter('give_form_level_output', 'kestcenter_custom_level_output', 99, 2);
       function kestcenter_custom_level_output( $output, $form_id ) {
       	$prices             = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
       	$display_style      = give_get_meta( $form_id, '_give_display_style', true );
       	$custom_amount      = give_get_meta( $form_id, '_give_custom_amount', true );
       	$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
       	$levels = kestcenter_get_give_donations();
       	if ( empty( $custom_amount_text ) ) {
       		$custom_amount_text = esc_html__( 'Give a Custom Amount', 'give' );
       	}
       	$output  = '';
       	$output .= '<label for="give-donation-level-select-' . $form_id . '" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
       	$output .= '<select id="give-donation-level-select-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';
       	$output .= '<option class="give-donation-level-choose" disabled="disabled" selected="selected">Choose your Level</option>';
       	//first loop through prices.
       	foreach ( $prices as $price ) {
       		$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
       		$exists = (in_array($price['_give_id']['level_id'], $levels) && $form_id == 61 ) ? 'disabled="disabled"' : '';
       		$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
       		$output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '" ' . $exists . '>';
       		$output .= $level_text;
       		$output .= '</option>';
       	}
       	//Custom Amount.
       	if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
       		$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
       	}
       	$output .= '</select>';
       	echo $output;
       }
       ```
   
 *  Plugin Contributor [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9758519)
 * HI [@databell96](https://wordpress.org/support/users/databell96/) — can you clarify
   exactly what you’re trying to accomplish with that code? Do you have some screenshots
   or examples you can point us to? This is definitely more of a custom developed
   solution, which we LOVE but don’t normally provide support for, but I’m happy
   to help give guidance if you can help me understand the use.
 * Thanks!
 *  Thread Starter [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9758616)
 * Well, it kind of relates to my other post where you have a default message that
   instead of displaying a level, it just displays a message like “Choose a level”
   or “Choose an amount” with no value in the value field (since there would be 
   no donation value at that point), and then the donator makes his or her decision
   from the other options in the select menu. Make sense?
 *  Plugin Contributor [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9762079)
 * In that case, here’s what I’d do instead.
 * 1) Enable the “Custom Amount” option
    2) Change the Custom Amount label to say“
   Choose an Amount” 3) Then add this snippet:
 *     ```
       add_action('wp_footer', 'set_give_default_dropdown_option');
   
       function set_give_default_dropdown_option() { ?>
   
       	<script>
               jQuery(document).ready(function( $ ) {
       			$("select.give-donation-levels-wrap").val('custom');
                   $("#give-amount").focus();
                   $("#give-amount").val('0');
       		});
       	</script>
       <?php
       }
       ```
   
 * Try that out instead, much easier in the end.
 *  Thread Starter [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9764957)
 * Think we got a winner, Matt! Thank you!
 *  Plugin Contributor [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9765424)
 * Glad to hear, happy to help!
 * If you’re enjoying Give and appreciate our support, we’d love a kind review from
   you here:
    [https://wordpress.org/support/plugin/give/reviews/](https://wordpress.org/support/plugin/give/reviews/)
 * Thanks!

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

The topic ‘Dropdown: Can’t reselect default selection’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [default](https://wordpress.org/support/topic-tag/default/)
 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [give wp](https://wordpress.org/support/topic-tag/give-wp/)
 * [initial](https://wordpress.org/support/topic-tag/initial/)
 * [selection](https://wordpress.org/support/topic-tag/selection/)

 * 7 replies
 * 3 participants
 * Last reply from: [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/dropdown-cant-reselect-default-selection/#post-9765424)
 * Status: resolved