WordPress.org

Ready to get started?Download WordPress

Forums

Search form with Combobox (1 post)

  1. tedzao
    Member
    Posted 4 years ago #

    Hi there... could any one help me?

    i am trying to create a search/ filter form ... but i am not able to do that ... and i have been trying to do that for a long time... :(

    The result is getting from a combobox (populated by a especific custom field) in the side bar, after selecting giving the posts with that custom field...

    i have done this already

    <form role="search" method="get" id="searchform" action="<?php get_bloginfo('URL'); ?> ">
                                                <fieldset>
    
                                                    <input type="text" name="s" id="search" value="<?php the_search_query('meta_key=referencia'); ?>" />
    
    <?php
                                            $cbox = '<select name="Concelho" style="width:291px; height:25px; text-align:left; font-size:9pt; padding-top:3px; margin-top:10px;">';
                                            foreach($Concelho as $key=>$val) :
                                            $cbox .='<option value="'.$val.'" selected="false">'.$val.'</option>';
                                            endforeach;
    
                                            $cbox .='<option value="" selected="true" >'.Seleccione.o.Concelho.'</option>';
                                            $cbox .= '</select>';
                                            echo $cbox;
                                            ?>
    
    <input type="image" alt="Search" src="/lowcost/wp-content/themes/low-cost/images/Single Page/enviar.png" />

    :( Any help?

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic