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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:46:06+00:00 2026-05-26T13:46:06+00:00

I’m trying to build a form that will have mixed inputs mostly text and

  • 0

I’m trying to build a form that will have mixed inputs mostly text and select. I want to fire ajax once x number of inputs are completed. I’ve tried the .change() function but have experienced issues with IE.

Example:

<div id='section'>
    <input type=text>
    <input type=text>
    <select>
        <option></option>
        <option></option>
    </select>
    <select>
        <option></option>
        <option></option>
    </select>
</div>

I don’t want a submit button I just want when all 4 inputs are complete do something. As I put before .change() had problems with IE when dealing with the select’s.

Would tying to bind all inputs with a blur / focusout and then check for complete on all inputs work or is there a better way?

I have right now

$('#section input').bind($.browser.msie ? 'focusout' : 'blur', function(e) {
// blur also has issues with IE so look for focusout in IE
console.log($(this));
}

I don’t care about the order of the the inputs being filled out I just want as soon as all 4 are filled out trigger an action, in my case an ajax call with those input values.

Some browser and jQuery info.
I have to support IE 6 +, and each major browser down 3 versions.
jQuery 1.6.2

  • 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-26T13:46:07+00:00Added an answer on May 26, 2026 at 1:46 pm

    An easier and more consistent approach would be to bind on the change event since that event will be unbiased to the type of form element.

    HTML:

    <form id="myform">
        <div id="section">
            <input name="baz" type="text" />
            <input name="bat" type="text" />
            <select name="foo">
                <option value=""></option>
                <option value="1">1</option>
                <option value="2">2</option>
            </select>
            <select name="bar">
                <option value=""></option>
                <option value="1">1</option>
                <option value="2">2</option>
            </select>
        </div>
    </form>
    

    JQuery:

    $('select,input').change(function() {
        var allgood = true;
        $('#section').children().map(function() {
            if (this.value.length.length < 1) {
                allgood = false;
            }
        });
        if(allgood){
            $('#myform').submit();
        }
    });
    

    DEMO: http://jsfiddle.net/AlienWebguy/5bcgW/

    Something to consider: this code assumes your form fields will be direct child nodes of the <div id="section"> parent. If you change your structure, just take note of how the JQuery selector is grabbing the form fields for the map() function.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.