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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:34:27+00:00 2026-05-30T22:34:27+00:00

I have a drop-down list box and two text fields of id values namely

  • 0

I have a drop-down list box and two text fields of id values namely user, datePicker1,datePicker2. I have this code, which works fine for user :

$("#user").change(function() {
   $.ajax({
      url: "${createLink(controller :"tasks", action : "test23")}",
      data: "userName=" + e1.find('option:selected').text(),
      cache: false,
      success: function(html) {
         $(".errors").append(html);
      }
   });
});  

that is, after a user selecting from the drop-down list, I send a ajax call and append the received data’s to the class of div errors.

But what I want actually is, after the user have have been selected from user div, I need to look for both datePicker1,datePicker2 events by keeping user div event the same. Now after both datePicker1,datePicker2 events are available I need to send a ajax call.

My html code :

user div element :

<select name="user.id" id="user" required="" class="many-to-one" >
<option value="">-Choose any User from the list</option>
<option value="1" >admin</option>
<option value="2" >anto</option>
</select> 

datePicker1 div element:

<input type="text" name="startDate" value="" id="datePicker1" /> 

datePicker2 div element:

<input type="text" name="endDate" value="" id="datePicker2" /> 

Edit:

After the user have selected values of all the three drop-down box then I can make a ajax call..So it means that I need three values from drop-down list and at the same time, a change to one field should call the ajax method provided that the other two field has already selected. Hope I’m clear on this.

How I can do this?

Can anyone help me out in this, I’m new to jquery and I got stuck with it.

Thanks in advance.

  • 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-30T22:34:28+00:00Added an answer on May 30, 2026 at 10:34 pm

    Well assuming the default values for the 3 fields are the empty string, you could do:

    $("#user,#datePicker1,#datePicker2").change(function() {
      if ($("#user").val() != "" && $("#datePicker1").val() != "" && $("#datePicker2").val() != "") {
         //make your ajax call
    
       } 
    
    
    });
    

    This will get fired whenever any of the fields change but will only submit the values to the server if all 3 values are set..

    Check this jsfiddle, it should work:

    http://jsfiddle.net/nFKT6/1/

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

Sidebar

Related Questions

Using Php I have wrote the drop down list box code. for Edit employee
I have a drop-down list with known values. What I'm trying to do is
I have a drop-down list hardcoded in an MVC View User Control page and
I have the following HTML containing a drop down list (single selection) <script type="text/javascript">
I have a <select> element in HTML. This element represents a drop down list.
Basically, I have a drop down list and a dynamically added user control. The
in my Application i have text box beside it i have drop down control.
I have a drop down list box and onchange I'm calling a function which
I have a drop down list's select tag that looks like this: <select name=MyName
I have a drop down list where users can select a theme for the

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.