Advertisement:

Author Topic: Country,State,City Issue  (Read 2438 times)

adsvads

  • Jr. Member
  • **
  • Posts: 50
Country,State,City Issue
« on: June 03, 2012, 10:03:08 am »
Hello Friends I need your help ,
I need the help for Country,State,City

First of all I need to make them into Drop-Down Menu.
Later When Country A is selected then States belonging to country A must be shown. When a particular State is selected then Major cities of that particular State must be shown. 

Thanks in advance :)

rvanar

  • Newbie
  • *
  • Posts: 29
Re: Country,State,City Issue
« Reply #1 on: June 03, 2012, 05:49:30 pm »
They made a Document section that has just what your looking for http://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations

HTH

SGH

  • Newbie
  • *
  • Posts: 3
Re: Country,State,City Issue
« Reply #2 on: August 24, 2012, 11:11:33 pm »
But how to edit these files that only state an country is drop-down. City would stay the same defualt, user's can type the location himself.

prekey

  • Newbie
  • *
  • Posts: 5
Re: Country,State,City Issue
« Reply #3 on: August 25, 2012, 08:26:52 am »
Yes , I also want the same issue.

I want to be like this <select region> <(based on selected region)select city> on search bar

Legion

  • Hero Member
  • *****
  • Posts: 622
  • I am founder of top20remedies.com buyeradvise.com
Re: Country,State,City Issue
« Reply #4 on: September 03, 2012, 03:45:41 am »
 http://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations
i tried this but couldnt find some codes in lates osclass 3.1

ellemos

  • Newbie
  • *
  • Posts: 13
Re: Country,State,City Issue
« Reply #5 on: November 03, 2012, 07:35:09 pm »
That help file about changing to dropdown works for the post item and edit item pages.

I found a way to get one dropdown. I used region dropdown and changed the code

<input type="text" id="sRegion" name="sRegion" value="<?php echo osc_esc_html( osc_search_region() ); ?>" />

to

<?php $conn = getConnection(); $aRegions = $conn->osc_dbFetchResults('SELECT * FROM %st_region ORDER BY s_name ASC', DB_TABLE_PREFIX); ?>
                                <?php if(count($aRegions) > 0 ) { ?>
                                    <select name="sRegion" id="sRegion">
                                        <option value=""><?php _e('Select a region...')?></option>
                                        <?php foreach($aRegions as $region) { ?>
                                        <option value="<?php echo $region['s_name'] ; ?>" <?php if(Params::getParam('sRegion') == $region['s_name']) { ?>selected<?php } ?>><?php echo $region['s_name'] ; ?></option>
                                        <?php } ?>
                                    </select>
                                <?php } ?>

But I need the city dropdown to show the cities according to the region selected.