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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:43:46+00:00 2026-06-11T20:43:46+00:00

I have a form for example: Country1 – State1 – City1 – (all three

  • 0

I have a form for example:
Country1 – State1 – City1 – (all three are drop-downs)

These are 3 different fields having unique ID, I can add more row & that will give me
Country2 – State2 – City2

If I select country, I am reloading the page to load list of states under state1 (or the state2 one) drop-down and so on.. (done by jquery).
Now, I want that when-ever I am selecting country1 or 2, after reloading the page it should focus on state1 or 2 or at-least on country1 or 2 respectively.

I dont know, whether this is possible or not.. but I need this 🙁

  • 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-11T20:43:48+00:00Added an answer on June 11, 2026 at 8:43 pm

    I would suggest you reload parts of the page using AJAX. Reloading the entire page is wasting resources both server side and client side. When you have already loaded the DOM, it makes sense to only refresh parts that you want to get from the server.

    Using jQuery you can conjure up something like:

    $.ajax({
        url: 'http://somedomain.tld/your_script_url',
        data: {
            country:$('#country_input').val(),
        },
        dataType:'json',
        type:'POST'
    });
    

    The URL should return either text OR HTML OR JSON. You should modify the value for dataType based on what you are returning.

    Also, the type should be either GET OR POST.

    You can use $("#your_id").focus(); to focus on an element.

    This will not only save you a lot of processing on the server side, but also help you write a common function to perform this task for every select element on the page.

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

Sidebar

Related Questions

I have a form with 3 fields (simplyfied example). The first one is a
I have a Profile form that inherits from sfGuardRegisterForm I have these fields: $this->useFields(
I have a form (for example, abc.frm ). I want the duplicate form (for
I have an array Y of the form(it is just an example, i have
I have this URL example.com/photo?people I want to rewrite this URL in the form
Example, if I have <form name=blah> <input name=1/> <input name=2/> <table> <tr> <td> <unkown
I have form where are 2 input fields and then i have dynamic dataTables
I have 3 tables in mySQL database. questions_table with these fields: question_id (unique ID
I have HTML form with lots of select and input fields, using it a
I have form, the form contains JavaStaticText fields, and Combo box, and Text fields.

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.