Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm totally new in PHP and I need to change following code which is textbox (input box) into a dropdown box, but I have no idea how to achieve this. someone help me, please. thanks


global $post;
$location = isset( $_REQUEST['location'] ) ? sanitize_text_field( $_REQUEST['location'] ) : '';
$current_page_id = isset( $_REQUEST['current_page_id'] ) ? absint( $_REQUEST['current_page_id'] ) : ( ( $post && $post->ID ) ? $post->ID : 0 );
?>




<!-- Search Text Field -->
                <div class="opalhotel-form-field">
                    <label class="opalhotel-form-lable"><?php esc_html_e( 'Location', 'opal-hotel-room-booking' ); ?></label>
                    <div class="opalhotel-form-field-group">
                        <input name="location" placeholder="<?php esc_attr_e( 'Enter your keyword', 'opal-hotel-room-booking' ); ?>" value="<?php echo esc_attr( $location ) ?>"/>
                        <?php if ( isset( $_REQUEST['hotel_id'] ) && $_REQUEST['hotel_id'] ) : ?>
                            <input type="hidden" name="hotel_id" value="<?php echo esc_attr( $_REQUEST['hotel_id'] ) ?>" />
                        <?php elseif( isset( $_REQUEST['room_id'] ) && $_REQUEST['room_id'] ) : ?>
                            <input type="hidden" name="room_id" value="<?php echo esc_attr( $_REQUEST['room_id'] ) ?>" />
                        <?php endif; ?>
                    </div>
                </div>
                <!-- end Search Text Field -->


What I have tried:

i tried few things but i cant figure it out
Posted
Updated 1-Aug-19 0:40am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900