This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

gs_ind

  • ***
  • 31 posts
Dropdown list in Post and Edit pages
« on: September 23, 2016, 05:22:43 PM »
Hello Frosticek,
I have only 1 region and 14 cities
1) Is it possible to have dropdown list for regions and cities in post ad page and edit ad page, so that users can select only one of the 14 cities. (i.e, users should not be able to add some other region or city)
2) Also is it possible to have similar dropdown in search page for region and cities.
3) The 'dropdown' for selecting 'region' in 'user-profile' is not working. So users cannot select/mofify region or city in user-profile.
Waiting for your valuable suggestions..
Thank you
« Last Edit: September 23, 2016, 07:15:17 PM by gs_ind »

*

gs_ind

  • ***
  • 31 posts
Re: Dropdown list in Post and Edit pages
« Reply #1 on: September 24, 2016, 04:22:53 AM »
Hello Frosticek,

Quote
3) The 'dropdown' for selecting 'region' in 'user-profile' is not working. So users cannot select/mofify region or city in user-profile.
I found the answer to the 3rd one.
Since I have only one country, it is not shown. (ie display: none)
When I changed the code(just below)
Code: [Select]
<?php UserForm::region_select($user['fk_c_country_code'] <> ' ' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>to
Code: [Select]
<?php UserForm::region_select($user['fk_c_country_code'equality operator ' ' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>it shows the region and cities

Waiting for your valuable suggestions for the Ist and 2nd Questions.
Thank you
« Last Edit: September 24, 2016, 04:28:06 AM by gs_ind »

*

MB Themes

Re: Dropdown list in Post and Edit pages
« Reply #2 on: September 25, 2016, 06:19:21 PM »
@gs_ind
Theme use primary autocomplete features of osclass instead of dropdown lists.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

gs_ind

  • ***
  • 31 posts
Re: Dropdown list in Post and Edit pages
« Reply #3 on: September 26, 2016, 02:19:37 PM »
@gs_ind
Theme use primary autocomplete features of osclass instead of dropdown lists.
Thanks for the tip  ;)
I changed the autocomplete for locations to dropdown.
Thanks again  :)

Re: Dropdown list in Post and Edit pages
« Reply #4 on: November 14, 2016, 09:38:55 PM »
with osclass code does not work, by mistake, how can I do?

Marked as best answer by frosticek on November 18, 2016, 09:47:17 AM
*

gs_ind

  • ***
  • 31 posts
Re: Dropdown list in Post and Edit pages
« Reply #5 on: November 18, 2016, 04:33:05 AM »
1) To have dropdown in item-post page:
a) For Regions:find the line shown just below (you should comment it)
Code: [Select]
<?php ItemForm::region_text($go_reg); ?>Insert the following just under it
Code: [Select]
<?php ItemForm::region_select($user['fk_c_country_code'] == '' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>b) For Cities: find the line shown below (you should comment it)
Code: [Select]
<?php ItemForm::city_text($go_city); ?>Insert the following just under it
Code: [Select]
<?php ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user()) ; ?>----------------------------------------------------------------------------------------------
2) To have dropdown in item-edit page:
a) For Regions:find the line shown just below (you should comment it)
Code: [Select]
<? php ItemForm::region_text(osc_item()); ?>Insert the following just under it
Code: [Select]
<?php ItemForm::region_select() ; ?>b) For Cities: find the line shown below (you should comment it)
Code: [Select]
<?php ItemForm::city_text(osc_item()); ?>Insert the following just under it
Code: [Select]
<?php ItemForm::city_select() ; ?>
Note: I have only one country in my site
(As I said comment the lines mentioned instead of deleting it.. so that if the above code doesn't work for you, you can un-comment those lines and delete the inserted lines)
Thank You

*

MB Themes

Re: Dropdown list in Post and Edit pages
« Reply #6 on: November 18, 2016, 09:47:27 AM »
@gs_ind
Thanks for your tip ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Dropdown list in Post and Edit pages
« Reply #7 on: November 22, 2016, 09:45:26 AM »
Thank you very much, it works ....

Re: Dropdown list in Post and Edit pages
« Reply #8 on: November 22, 2016, 09:57:14 AM »
there is an error if I select the region and cities in user profile when I go to post to the box select the region is blocked.

*

MB Themes

Re: Dropdown list in Post and Edit pages
« Reply #9 on: November 22, 2016, 10:40:32 AM »
@Antimo
It is not blocked, but you do not have any regions in this select box.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Dropdown list in Post and Edit pages
« Reply #10 on: November 22, 2016, 11:49:56 AM »
no when I try, if I enter my region in the user profile when I go to post to not make me change the region.

Re: Dropdown list in Post and Edit pages
« Reply #11 on: November 22, 2016, 12:13:37 PM »
when I save my region in the user profile and go to insert a post region it is locked in my region.

*

gs_ind

  • ***
  • 31 posts
Re: Dropdown list in Post and Edit pages
« Reply #12 on: November 22, 2016, 01:19:28 PM »
There seems to be a bug in osclass (user-profile.php) as a result of which the country does not get entered in user's profile

Change the following code in user-profile.php :
Code: [Select]
  <?php UserForm::region_select($user['fk_c_country_code'] <> '' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>
to

Code: [Select]
  <?php UserForm::region_select($user['fk_c_country_code'] == '' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>
Check if this works for you
« Last Edit: November 22, 2016, 01:21:01 PM by gs_ind »

Re: Dropdown list in Post and Edit pages
« Reply #13 on: November 23, 2016, 09:19:30 AM »
Hi, the problem is when I go to post the item region selection box gets stuck on the region inserted in user plofile.

Re: Dropdown list in Post and Edit pages
« Reply #14 on: November 23, 2016, 09:35:15 AM »
the problem is only in post item, the region remains locked box gets stuck with the region inserted in the profile. I include photos of item_post code. Thank you very much