hi

i have many pieces of code like:
Code JavaScript:
 <script type="text/javascript">
    dojo.query("body").delegate("#input0 > select.estatistica", "onchange", function(evt){
            dojo.xhrPost({
                url: "drop2.php",
                handleAs: "json",
                postData: "data=" + $(this).val(),
                preventCache: true,
                load: function(json) {
                    $m0 = [];
 
                    for (var i = 1; i < 10; i++) {
                        $m0.push(parseFloat(json[i]["valor" + i]));
                    }
                    dojo.addOnLoad(refreshChar0);
 
                }
            });
        });
    </script>
 
 
    <script type="text/javascript">
    dojo.query("body").delegate("#input1 > select.estatistica", "onchange", function(evt){
            dojo.xhrPost({
                url: "drop2.php",
                handleAs: "json",
                postData: "data=" + $(this).val(),
                preventCache: true,
                load: function(json) {
                    $m1 = [];
 
                    for (var i = 1; i < 10; i++) {
                        $m1.push(parseFloat(json[i]["valor" + i]));
                    }
                    dojo.addOnLoad(refreshChart1);
                }
            });
        });
    </script>

i tried this loop, but i am not sure about the script. Probably i have syntax errors.

Code JavaScript:
[CODE]    <script type="text/javascript">
    for(x=0; x<10; x++) {
    dojo.query("body").delegate("'#input'+x+'> select.estatistica'", "onchange", function(evt) {
            dojo.xhrPost({
                url: "drop2.php",
                handleAs: "json",
                postData: "data=" + $(this).val(),
                preventCache: true,
                load: function(json) {
                    $m+x = [];
 
                    for (var i = 1; i < 10; i++) {
                        $m+x.push(parseFloat(json[i]["valor" + i]));
                    }
                    dojo.addOnLoad(refreshChart+x);
                }
            });
        });
    }
    </script>
[/CODE]

thanks