Given code that calculates (and then constructs) how many text boxes a page has:
var gEmails = '<p>Please enter your desired emails</p>';
for (var i = 0; i < numInputs2Render; i++) {
gEmails = gEmails + '<input type="text" id="Email' + i + '" class="emailInput">';
}
How can I add code that can tell each input has been blurred by the user? This answer gets me oh so close but i need code that is fired when one of my dynamic text boxes hears a blur event so I can test for non-empty condition in _all matched inputs.
thx
Listen to the blur event on all input fields. This callback function will be fired if any of the fields is blurred.
You can also setup a live handler using
so you don’t have to keep binding the blur event when new inputs are inserted. Just do it once initially and it will take care of all dynamically inserted text boxes.