John Magnolia
John Magnolia

Reputation: 16793

Jquery onchange alternative that works with auto fill form plugins

How can I get the JavaScript onChange to work with a autofill form extension. The problem is that when you click the button to autofill the form it doesn't call the onChange. Is thre a work around for this?

Example HTML:

<select onchange="$('select[name=\'zone_id\']').load('index.php?country_id=' + this.value + '&amp;zone_id=');" name="country_id">
      <option value="false"> --- Please Select --- </option>
      <option value="1">Afghanistan</option>
      <option value="2">Albania</option>
      <option value="3">Algeria</option>
</select>

Upvotes: 1

Views: 419

Answers (1)

Adam Hopkinson
Adam Hopkinson

Reputation: 28795

I had the same problem, though with input fields rather than select. The browser form autofill feature doesn't fire any js events as far as I could see, so I ended up using setInterval to periodically validate the fields.

Upvotes: 2

Related Questions