Results 1 to 1 of 1

Thread: Retrieve value from a drop-down custom field!

  1. #1
    Thread Starter
    Rookie g-saint's Avatar
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieve value from a drop-down custom field!

    Does anyone know how to retrieve the value of a drop-down custom field when editing the ad?

    When retrieving the value of a text field you'd use:
    Code:
    <label><?php _e('Location','cp');?>
    
    <input type="text" name="location" class="mid2" id="location" value="<?php echo get_post_meta($getmyad->ID, "location", true); ?>" size="55" maxlength="100" /></label>
    But for a drop-down (in my case):
    Code:
    <label><?php _e('City','cp'); ?></label>
    
    <select id="city" name="city" />
    <option value="N/A">// Select City //</option>
    <option value="Sydney">Sydney</option>
    <option value="Melbourne">Melbourne</option>
    <option value="Brisbane">Brisbane</option>
    <option value="Gold Coast">Gold Coast</option>
    <option value="Perth">Perth</option>
    <option value="Darwin">Darwin</option>
    <option value="Canberra">Canberra</option>
    <option value="Hobart">Hobart</option>
    </select>
    * I think that's not the correct way to display the "select" field. Does any one would know how to fix it?

    Thanks!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)