Chained select boxes not working
<p>I have three select boxes state,city and locality with the id's same as name</p>

<pre><code>$(document).ready(function() {
    $("#state").on('change',function(){
        var state = $("#state").attr('value');
        $("#city").load('http://localhost/trial/index.php/new/view_cities/'+state).change();
    }).change();

    $("#city").on('change',function(){
        var city = $("#city").attr('value');
        $("#locality").load('http://localhost/trial/index.php/new/view_localities/'+city);
    }).change();
});
</code></pre>

<p>On page load state gets correctly shown because it's directly from database, and city options gets automatically updated, but localities do not. And when i change city the localities can change.</p>
