• Suppose that I lived in a large country, like the U.S., Russia or China. So it would be a good idea to have a dropdown list for ‘province’ or ‘state’, and a dropdown list for ‘city’.
    How can I make the ‘city’ dropdown list conditional to the ‘province’ dropdown list, so when I choose a province, only the cities in that particular province are shown in the next dropdown box?

    Also, how can I remove the first taxonomy from the dropdown list? For example, in the demo version of winningagent (https://demo.winningagent.com/winning-agent-pro-theme/), if you click on the first dropdown list ‘status’, ‘status’ appears as the first option, and likewise for the rest of the dropdown boxes, the first option is always the name of the taxonomy, which doesn’t look good.

    Thanks

    https://www.ads-software.com/plugins/agentpress-listings/

Viewing 1 replies (of 1 total)
  • Plugin Support Nick C

    (@modernnerd)

    Hi, ryan94!

    The plugin doesn’t currently support conditional select boxes or omitting the first taxonomy label from each drop down like you describe, unfortunately.

    You may be able to achieve both changes with custom code, although this would likely mean modifying the plugin (which can make future updates tricky).

    For example, commenting out this line from plugins/agentpress-listings/includes/class-property-search-widget.phpclass-property-search-widget.php would remove the taxonomy labels from each drop-down:

    echo '<option value="" ' . selected( $current == '', true, false ) . ">{$data['labels']['name']}</option>\n";

    You could also consider hiding or removing the first label from each drop-down with JavaScript.

    If you’d like further help with customisation, you’re welcome to ask in the StudioPress forums: https://d.pr/1fTeS

Viewing 1 replies (of 1 total)
  • The topic ‘How can I make a dropdown list conditional?’ is closed to new replies.