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 8902061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:31:09+00:00 2026-06-15T01:31:09+00:00

My contact form page, for user edit details, has two drop-down fields, ‘country’ and

  • 0

My contact form page, for user edit details, has two drop-down fields, ‘country’ and ‘city’.
I would like when a user is edit his details that the ‘city’ field will be disabled until something is selected in the ‘country’ drop-down menu.

<form name="item" action="<?php echo base_url(true) ?>" method="post">

<label><?php _e('Country', 'my_theme'); ?></label>
<?php ItemForm::country_select(get_countries(),user()) ; ?>

<label><?php _e('City', 'my_theme'); ?></label>
<?php ItemForm::cities_select(get_cities(),user()) ; ?>

<button class="itemFormButton" type="submit"></button>
</form>

I’ve tried ‘onchange’ in javascript, probably with wrong syntax…

How can I create this?
Thx.

  • 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-06-15T01:31:10+00:00Added an answer on June 15, 2026 at 1:31 am

    This might help you http://jsfiddle.net/GZ269/. This uses jquery.

    Country:<br />
    <select id="drop1">
        <option value="">Select Country</option>
        <option value="c1">Country 1</option>
        <option value="c2">Country 2</option>
    </select>
    <br />
    City:<br />
    <select id="drop2" disabled >
        <option value="">Select Country</option>
        <option value="c1">Country 1</option>
        <option value="c2">Country 2</option>
    </select>
    

    Javascript function:

    $("#drop1").change(function(){
        var country = $(this).val();
    
        if(!country){
            $("#drop2").attr("disabled", true);
            return false;
        }
    
        $("#drop2").attr("disabled", false);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A form on my website's contact -us HTML page has two fields 1) subject
I'm adding a contact to my database with a form on the page add.php,
I have a contact page (contact.php) that sends a form (formsend.php) when people fill
how can i re-direct to a particular page after the user submits the contact
I have a form field where a user enters contact information, including name, email,
I have a web page, and after the contact form is submitted, the contents
I have an HTML5 form set up like so: <form id=contact-form action=php/email.php> <fieldset> <ul
Ok I have our contact form fully working, and processing correctly. I have two
I have created a basic contact form, and when the user submits information, it
I have a contact form open in thickbox i want when user click on

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.