Stuart,

>for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
>       schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
>}

This is brought up a lot on the list. You need:

for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
        schedule[dayNum] = $("[EMAIL PROTECTED]'scheduleHours[" + dayNum +
"]']").val();
}

You selector should look like:

$("[EMAIL PROTECTED]'scheduleHours[0]']")

However, I'd recommend change the "id" of your elements and changing them to
something like:

<input type="hidden" id="scheduleHours_0" name="scheduleHours[0]"
value="7.5" />
<input type="hidden" id="scheduleHours_1" name="scheduleHours[1]"
value="7.5" />
<input type="hidden" id="scheduleHours_2" name="scheduleHours[n...]"
value="7.5" />

Then you could use:

for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
        schedule[dayNum] = $('#scheduleHours_' + dayNum).val();
}

-Dan

Reply via email to