Hey all,
I'm creating forms (one for each record) dynamically using asp. The forms are named and id'd as "attemptForm_{attemptID}".
My problem is that the first records (always the first and only the first) returns an error when I try to submit it.
If I use document.attemptForm_123.submit() the browser says that "document.attemptForm_123 is null or not an object".
If I use getElementById('attemptForm_123').submit() it says "Object doesn't support this property or method".
Below is the is the html, as it appears in the source, for the first (doesn't work) and second (works perfect) forms:
(sorry if it's ugly)
I'm creating forms (one for each record) dynamically using asp. The forms are named and id'd as "attemptForm_{attemptID}".
My problem is that the first records (always the first and only the first) returns an error when I try to submit it.
If I use document.attemptForm_123.submit() the browser says that "document.attemptForm_123 is null or not an object".
If I use getElementById('attemptForm_123').submit() it says "Object doesn't support this property or method".
Below is the is the html, as it appears in the source, for the first (doesn't work) and second (works perfect) forms:
(sorry if it's ugly)
Code:
<form id="attemptForm_12859" name="attemptForm_12859" action="javascript:doPopup2('../Engraph/scr_mark_exam_e.asp?', 800, 600, 1);" style='margin:0px;'>
<input type=hidden name=attemptID value=12859>
<input type=hidden name=loginID value=161>
<tr style='font-weight: bold; background-color:#EFE7DC;'>
<td valign=top nowrap style='padding: 2px 15px; '>555-A458-IA-54</td>
<td valign=top nowrap style='padding: 2px 15px; '>Blow, Joe</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>e</td>
<td valign=top nowrap style='padding: 2px 15px; '>10-Sept-2007</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>N/A</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>N/A</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Mark' src='../../../images/ok_16x16.gif' onClick="document.attemptForm_12859.submit();">
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='View' src='../../../images/view_16x16.gif'>
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Print' src='../../../images/print_16x16.gif' disabled>
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Delete' src='../../../images/delete_16x16.gif'>
</a>
</td>
</tr>
</form>
Code:
<form id="attemptForm_12873" name="attemptForm_12873" action="javascript:doPopup2('../Engraph/scr_mark_exam_e.asp?', 800, 600, 1);" style='margin:0px;'>
<input type=hidden name=attemptID value=12873>
<input type=hidden name=loginID value=161>
<tr style='font-weight: bold; background-color:#EBE1D3;'>
<td valign=top nowrap style='padding: 2px 15px; '>555-A458-IA-54</td>
<td valign=top nowrap style='padding: 2px 15px; '>Blow, Joe</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>e</td>
<td valign=top nowrap style='padding: 2px 15px; '>18-Sept-2007</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>N/A</td>
<td valign=top align=center nowrap style='padding: 2px 15px; '>N/A</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Mark' src='../../../images/ok_16x16.gif' onClick="document.attemptForm_12873.submit();">
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='View' src='../../../images/view_16x16.gif'>
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Print' src='../../../images/print_16x16.gif' disabled>
</a>
</td>
<td valign=top align=center nowrap style='padding: 2px 5px; '>
<a href='#'>
<img alt='Delete' src='../../../images/delete_16x16.gif'>
</a>
</td>
</tr>
</form>