loading second option values when first value is selected with javascript
<p>Got a problem.</p>

<p>I have these two javascripts:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(function () {
        function pad(n) {
            return n &lt; 10 ? '0' + n : n
        }
        var date = new Date();

        var selectElement = $('&lt;select name="date" id="date" class="validate[required]"&gt;'),
            optionElement;

        for (var count = 0; count &lt; 90; count++) {
            var day = date.getUTCDay();
            if (day == 1 || day == 2 || day == 3 || day == 4 || day == 5 || day == 6) {
                //formattedDate = pad(date.getUTCDate()) + '-' + pad(date.getUTCMonth()+1) + '-' +       date.getUTCFullYear();
                formattedDate = pad(date.getFullYear()) + pad(date.getMonth() + 1) + pad(date.getDate());

                showDate = pad(date.getDate()) + '.' + pad(date.getMonth() + 1) + '.' + date.getFullYear();

                optionElement = $('&lt;option&gt;')
                optionElement.attr('value', formattedDate);
                optionElement.text(showDate);
                selectElement.append(optionElement);
            }
            date.setDate(date.getDate() + 1);
        }
        $('#date').append(selectElement);
    });
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        $("#date").change(function () {
            var value = $(this).children('option:selected').val();
            $("#time").load("test.php", {
                value: value
            });
        });
    });
&lt;/script&gt;
</code></pre>

<p>So when I select the first value (here a date) the second javascript should return times from a query which is made in an php.</p>

<p>If I tamper the script there are no values submitted from the first script to the second script.</p>

<p>I need help here. Thanks.</p>
