Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1055669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:35:57+00:00 2026-05-16T17:35:57+00:00

How can I customise a form to only show the relevant countries when selecting

  • 0

How can I customise a form to only show the relevant countries when selecting a region in my form below?

This is my code

<form id="sobi2Search" name="sobi2Search" action="index.php"
    method="get"><input type="hidden" value="com_sobi2"
    name="option"> <input type="hidden" value="search"
    name="sobi2Task"> <input type="hidden" value="1"
    name="Itemid">

<table width="100%" class="">
    <tbody>
        <tr>
            <td>
            <h6>Search over <b><u> 82 </u></b> companies</h6>
            </td>
        </tr>
        <tr>
            <td><input type="text"
                onfocus="if(this.value=='') this.value='';"
                onblur="if(this.value=='') this.value='';" value=""
                size="20" class="inputbox" alt="search" maxlength="20"
                name="sobi2Search"></td>
        </tr>
        <tr>
            <td><select id="sobiCid" class="inputbox catChooseBox"
                name="sobiCid" size="1">
                <option value="0">Search all services</option>
                <option value="3">Accommodation</option>
                <option value="6">Airlines</option>
                <option value="5">Tour Operators</option>
                <option value="4">Overland / Self Drive</option>
                <option value="7">Tourist Boards</option>
            </select></td>
        </tr>
        <tr>
            <td><select name="field_region" size="1"
                class="inputbox" id="field_region">
                <option value="all">Search all regions</option>
                <option value="North Africa">North Africa</option>
                <option value="East Africa">East Africa</option>
                <option value="Southern Africa">Southern Africa</option>
                <option value="Central Africa">Central Africa</option>
                <option value="West Africa">West Africa</option>
                <option value="Indian Ocean Islands">Indian
                Ocean Islands</option>
            </select></td>
        </tr>
        <tr>
            <td><select name="field_countries" size="1"
                class="inputbox" id="field_countries">
                <option value="all">Search all countries</option>
                <option value="Algeria">Algeria</option>
                <option value="Angola">Angola</option>
                <option value="Benin">Benin</option>
                <option value="Botswana">Botswana</option>
                <option value="Cameroon">Cameroon</option>
                <option value="DR Congo">DR Congo</option>
                <option value="Egypt">Egypt</option>
                <option value="Ethiopia">Ethiopia</option>
                <option value="Gabon">Gabon</option>
                <option value="Gambia">Gambia</option>
                <option value="Ghana">Ghana</option>
                <option value="Kenya">Kenya</option>
                <option value="Lesotho">Lesotho</option>
                <option value="Libya">Libya</option>
                <option value="Madagascar">Madagascar</option>
                <option value="Malawi">Malawi</option>
                <option value="Mali">Mali</option>
                <option value="Mauritius">Mauritius</option>
                <option value="Morocco">Morocco</option>
                <option value="Mozambique">Mozambique</option>
                <option value="Namibia">Namibia</option>
                <option value="Niger">Niger</option>
                <option value="Rwanda">Rwanda</option>
                <option value="Senegal">Senegal</option>
                <option value="Seychelles">Seychelles</option>
                <option value="South Africa">South Africa</option>
                <option value="Swaziland">Swaziland</option>
                <option value="Tanzania">Tanzania</option>
                <option value="Tunisia">Tunisia</option>
                <option value="Uganda">Uganda</option>
                <option value="Zambia">Zambia</option>
                <option value="Zimbabwe">Zimbabwe</option>
            </select></td>
        </tr>

        <tr>
            <td><br>
            <input type="submit" value="Search" class="green-button"
                name="search"></td>
        </tr>
    </tbody>
</table>
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:35:58+00:00Added an answer on May 16, 2026 at 5:35 pm

    HTML by itself will not do the trick. You will have to use JavaScript for something like this:

    I would use aJax, and load countries once region is selected.
    The database table needs to look something like this.

    |———————–|
    | region   | country |
    |———————–|
    | florida   | usa       |
    | georgia | usa       |
    | texas     | usa       |
    | ghana   | africa south       |
    | africa    | africa       |
    |———————–|

    <option name="country" onchange="loadRegions();">
     <option value="usa>usa</option>
     <option value="africa">africa</option>
    </option>
    
    <option name="regions"></option>
    
    <script type="text/javascript">
    function loadRegions(){
      // create ajax request to php script that returns json (array of objects/strings)
      // in case of Joomla you want to call the controller 'index.php?option=com_mycomponents&controller=regionFilter&country=[selected country]
      // pass country as parameter
      // clear the regions 
      // set the regions to the json data
    
    }
    </script>
    

    You are better of using some Ajax library for this:
    JQuery or Mootools. Here is a demo http://demos.mootools.net/Request.JSON of json request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.