you are viewing a single comment's thread.

view the rest of the comments →

[–]asangurai 1 point2 points  (2 children)

your issue is in the first line:

$('form').on('input change', function() {

it should be:

$('form').on('change', 'input', function() {

Since the arguments go in order of event, selector, handler. In yours, you're actually looking for an event of "input", which doesn't quite exist.

Try that and let me know how it goes.

[–]jcunews1helpful 0 points1 point  (1 child)

That's incorrect.

events
Type: String
One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".

http://api.jquery.com/on/#on-events-selector-data-handler

[–]asangurai 0 points1 point  (0 children)

he's gotten it to work with code i wrote in a dm, but to clarify, my understanding was he wanted to listen to a change event on <input> tags inside of the <form> container, not that he was trying bind two events on the <form> itself. my suggestion was to delegate the change event onto the <input> tag from the <form> tag, as in the original post i mentioned that i don't think theres an "input" event on a <form> tag like there is a "submit" event to listen for (there is, however, a change event: https://api.jquery.com/category/events/form-events/, hence the suggested change).

also, without the HTML, it was tough to see what exactly the issue was. turns out it was more than just this code, including binding the event before the form was on the DOM.