Osclass Support Forums
Osclass theme support => Sigma Osclass Theme => Topic started by: chris on December 08, 2020, 11:04:27 AM
-
hi,
i have only one country on my website : France (and it will stay like this)
i want location input shown as a dropdown list
i want users can access the item-post.php file even if they are not logged in (or if they are but they have not selected a city as user)
There is a little problem in that case, because :
as there is only one country, country choice does not appear in item-post.php but the country is not pre selected so you can't select a region, and neither a city.
i would like that the country be auto selected. That way, when user want to add his listing, he should directly select a region which is under the country (France in my case, PK_C_CODE = "FR")
Thanks for your time guys !
-
@chris
If you add following code to your item-post.php, it could work.
<script>
$(document).ready(function() {
$('select[name="countryId"]').val($('select[name="countryId"] option:last').val());
$('select[name="countryId"]').change();
});
</script>
or
<script>
$(document).ready(function() {
$('select[name="countryId"]').prop("selectedIndex", 1);
$('select[name="countryId"]').change();
});
</script>
-
thank you very much. i will buy you 2 or 3 plugins
-
@chris
Or 23 8)
-
i've bought 3, as you can notice, but waiting for some answers on other topics to buy more :)
-
@chris
Approved.