Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42

Thread: Location drop down by State and City

  1. #21
    Junior Member
    Not a Verified Customer
    xiscomax's Avatar
    Join Date
    Oct 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    I added a dropdown list with 4 options on the edit page of ads, but forces me to select the location again, otherwise it does not validate the field.

    Any solution to some experts?

    my code.

    Code:
    	
    
    <label>Selection  *(Options)
    
                    <select name='location' id='location' class='postform' >
                    <option value="<?php if ($hfield == '3') { echo $errcolor; } ?>" ><?php echo get_post_meta($getmyad->ID, "location", true); ?> </option>
                    <option value="Option 1">Option 1</option>
                    <option value="Option 2">Option 2</option>
                    <option value="Option 3">Option 3</option>
                    <option value="Option 4">Option 4</option>
                    </select></label></p>

  2. #22
    Member collegism's Avatar
    Join Date
    Apr 2009
    Location
    Minneapolis, MN
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    Damien, did you figure out how to get this into tpl-edit-ad.php?

  3. #23
    Junior Member
    Not a Verified Customer
    phanik's Avatar
    Join Date
    Dec 2009
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    thanks for the detailed tutorial, i have successfully implemented in my website.
    I have added more than 15 states and over 100 cities of india.

  4. #24
    Junior Member
    Not a Verified Customer
    phanik's Avatar
    Join Date
    Dec 2009
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    I find a problem with this change,
    Problem is: When you select (State, City). Location custom filed is storing only city name. which in turn google map show only city name not with a combination of state+city.

    Eg: If i select "Connecticut" as state and "Bristol" as city name. Then google maps shows "famous city "Bristol" which is from UK, Instead of showing it from US.

    So is there any solution were we can tell post-form.php to store state, city in Location custom field ?

  5. #25
    Rookie
    Not a Verified Customer
    mgandp's Avatar
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    I have one question about this solution.

    It doesn't require the poster to select any area if the the "- Select Area - " is selected. This means that it is bypassing the requirement for location.

    Any solution for this?

  6. #26
    Newbie
    Not a Verified Customer
    jhowlett12's Avatar
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    Quote Originally Posted by tristan
    How can you add more than 4 options to the first drop down??

    Every time I try, it just hangs with the 2nd drop down box empty.

    Any help would be great! Thanks

    -Tristan
    change the number in your js file from 4 to 5 (it needs to be 1 number higher than the items in your list)

    I am looking to get this on tpl-edit-ad.php any one figured that out?

    Plus I would like to have a list of states on my homepage that they can select and have it return just the items within that state and/or city.

    thank you

    J

  7. #27
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Location drop down by State and City

    thanks, this is very helpful!

    however, there are the usual quirks for IE8 if I assign the ID to a <select> element instead of a <div>

    I need to have this working on <select> because what changes in my configuration must be only the <option>s elements (I want to use more than one instance of this script and each instance has different parameters on <select>; if I load the html from the <div>, the <select> will be always the same)

    with ID assigned to <select> it works in FF3.6, Opera10, Chrome4 but not IE8 or IE7... and I can't figure out why

    in IE8 it doesn't populate the 2nd <select> dropdown element... I tried to eliminate the other instances and use only one, but still doesn't work... perhaps it's something in the javascript? I wish I could fix this...

  8. #28
    Thread Starter
    Member damien's Avatar
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    I will try this whole "mod" again shorty and see if I can make improvements. Sounds like a few bugs

  9. #29
    Newbie amril's Avatar
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    Hi all,
    i create a file step by step for the location,
    but when i select the location...this error shown....please help

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  10. #30
    Thread Starter
    Member damien's Avatar
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location drop down by State and City

    Quote Originally Posted by amril
    Hi all,
    i create a file step by step for the location,
    but when i select the location...this error shown....please help

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    make sure the path to city.php is correct, that you have it in the right location
    Code:
    <? bloginfo('template_directory'); ?>/city.php
    so it should be in the root of the classipress theme folder, with header.php, footer.php, etc.

    That's the only reason I can think of it 404'ing like that, it cant find city.php. Or perhaps you have RewriteBase /directory/ issue in your .htaccess for a subdomain running wordpress?

Page 3 of 5 FirstFirst 12345 LastLast

Thread Information

Users Browsing this Thread

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