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

  • Home
  • SEARCH
  • 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 7704789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:45:36+00:00 2026-05-31T23:45:36+00:00

Dropdown list 1: <select name=ddlArea onchange=showState(this.value)> Dropdown list 2: <select name=ddlFType onchange=showState(this.value)> I want

  • 0
Dropdown list 1:

<select name="ddlArea" onchange="showState(this.value)">  

Dropdown list 2:

<select name="ddlFType" onchange="showState(this.value)">  

I want to get selected values of both dropdown lists in showState function. I want to invoke same function as the ajax request will be processing on different page which requires both the parameters Area and FType.

Function:

function showState()
                {
                     var area_value = document.getElementById("ddlArea").value;
                     var ftype= document.getElementById("ddlFType").value;
                    if(document.getElementById("ddlFlat").value!="-1" )
                    {
                        xmlHttp=GetXmlHttpObject()
                        if (xmlHttp==null)
                        {
                            alert ("Browser does not support HTTP Request")
                            return
                        }
                        var url="vacant_do.jsp"
                        url=url+"?area_id="+area_value+"ftype"+ftype

                        xmlHttp.onreadystatechange=stateChange
                        xmlHttp.open("GET",url,true)
                        xmlHttp.send(null)

                    }
                    else
                    {
                        alert("Please Select Area Name");
                    }
                }

                function stateChange()
                {
                    if (xmlHttp.readyState==4 || xmlHttp.readyState==200)
                    {
                        document.getElementById("ddlFlat").innerHTML=xmlHttp.responseText
                         }
                }
  • 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-31T23:45:37+00:00Added an answer on May 31, 2026 at 11:45 pm

    Since you are just trying to invoke an AJAX Query with 2 parameters, I wouldn’t push in the value through the onChange.

    Combo -Box 1:-  
    <select name="ddlArea" id="ddlArea" onchange="showState()">  
    Combo -Box 2:-  
    <select name="ddlFType" id="ddlFType" onchange="showState()">  
    

    and then:

    function showState()  {  
       var area = document.getElementById('ddlArea').value;
       var fType= document.getElementById('ddlFType').value;
       ....invokeAJAX request....
    }
    

    You COULD do this via some sort of prototype/closure method, but really, you already know where to get the information from, and it’s not going to change 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 dropdown list in my django template: <select name=submit_new id=submit_new> <option value=Stdo>Studio</option>
I have a dropdown list and a select list. Both contain quite a few
So I have a dropdown list <select id=theSelectId> <option value=volvo>Volvo</option> <option value=saab>Saab</option> <option value=mercedes>Mercedes</option>
I have a dropdown list for items. What I want to do is get
The code I am using for the dropdown list is this: <%= f.select :post_type_id,
I need a textfield which has an dropdown list to select an option from
My webpage allows users to select items from a dropdown list and has a
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
I'd like to be able to select a specific option within a dropdown list
Suppose I have a drop-down list like: <select id='list'> <option value='1'>Option A</option> <option value='2'>Option

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.