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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:53:25+00:00 2026-06-09T14:53:25+00:00

what are the best practices to binding events triggered by multiple input fields which

  • 0

what are the best practices to binding events triggered by multiple input fields which are dependent on each other in jquery?

For eg: lets take a search engine which searches for students based on what is entered and selected in the fields below.

1. text boxes
2. select lists
3. select boxes
4. option buttons

Without a button which will trigger these events, what is the best way to achieving the following:

  1. Displaying search result as soon as user enters or selects values in one of the input fields and refines the search as users enters or selects values in other fields options.

  2. Displaying search result only after each fields has a valid value.

Any input would be appretiated.

  • 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-09T14:53:27+00:00Added an answer on June 9, 2026 at 2:53 pm

    I’ve put this together this jsFiddle http://jsfiddle.net/VJwpv/1/.

    If you are looking at doing validation with JavaScript then I’d recommend you look into this jQuery Validation plugin

    HTML

    <div id="searchForm"> 
        <input id="textBox" class="searchField" type="text" />
        <select id="dropDown" class="searchField">
            <option value="Option1">Option1</option>
            <option value="Option2">Option2</option>
        </select>
        <input id="checkbox1Value" type="checkbox" name="checkbox" value="Checkbox1" />Checkbox1 
        <input id="checkbox2Value" type="checkbox" name="checkbox" value="Checkbox2" />Checkbox2
        <input type="radio" name="radio" value="Radio1" /> Radio1
        <input type="radio" name="radio" value="Radio2" /> Radio2
    </div>
    
    <div id="results"></div>
    

    JavaScript

    function validateForm() {
        // if valid
        return true;
        // else return false
    }
    
    function performSearch() {
        var textBoxValue = $("#textBox").val();
        var dropDownValue = $("#dropDown").val();
        var checkbox1Value = $("#checkbox1Value").is(":checked");
        var checkbox2Value = $("#checkbox2Value").is(":checked");
        var radioValue = $("input:radio[name=radio]:checked").val();
        // What you'd actually do here is an AJAX call to get the search results
        // and pass all the values defined above in the request
        $("#results").html("Textbox: " + textBoxValue + ". Dropdown: " + dropDownValue + ". Checkbox1: " + checkbox1Value + ". Checkbox2: " + checkbox2Value + ". Radio: " + radioValue);
    }
    
    function onChange() {
        if (validateForm()) {
            performSearch();
        }
    }
    
    $(document).ready(function() {
        $("#searchForm input, #searchForm select").change(function() {
            onChange();
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering about some best practices for data binding in web forms. For
Lately when binding click events in jQuery I find myself questioning whether to use
Best practices or tools for installing a SQL Server database I have a SQL
About best practices on designing stored procedures, should a stored procedure updating a record
What best practices have you used in unit testing embedded software that are peculiar
I am looking for best practices of avoiding constructor injection overuse. For example I
Its more of a best practices sort of question. Here it goes... I have
Possible Duplicate: Best practices for efficiently storing md5 hashes in mysql We use Hex
What are the current best practices with git branches that have been created to
What are the best practices for creating exceptions? I just saw this, and I

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.