Register Plus Redux
How to create a default choice for the dropdown Select Field? (3 posts)

  1. WPChina
    Posted 5 years ago #

    I'm glad I found this plugin! Is there a way to have one of the choices in my "Select Field" the default choice?

    For example, if I have "apple,banana,candy,donut,eggplant,french fry,grape,hamburger" in my dropdown alphabetically, but I want the "grape" choice to the be default choice that users first see. Is there a code or notation I can use to make sure that appears on the dropdown menu for that Select Field?



  2. radiok
    Plugin Author

    Posted 5 years ago #

    Unfortunately there is not a way to set up a default choice for select fields. That is a great request. In the meantime, you could write some jQuery to accomplish pretty much the same thing. Whenever the page loads to change the value of a certain field, be that food, you would jQuery("#food").val("grape"); or something like that.

  3. WPChina
    Posted 5 years ago #

    Excellent workaround and thanks for your quick help! It would be great to see a non-jQuery addition to the script in the future, but this is what I added now and it works very well:

    <script type="text/javascript">
    jQuery(document).ready(function() {

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic