Forum Moderators: open
function addRowToTable()
{
var tbl = document.getElementById('tblSample').tBodies[0];
var row = tbl.insertRow(-1);
// goal number cell
var newCell0 = row.insertCell(0);
txtNumber = "<b><%=strGoalNum%></b>";
newCell0.innerHTML = txtNumber;
newCell0.style.backgroundColor="#999999";
newCell0.style.verticalAlign = "top";
//goal
var newCell1 = row.insertCell(1);
txtGoal = "<form action='strategic_plan_c.asp?GoalIDFromPage=<%=strGoalIDFromPage%>' method='post' name='SP_Input' id='SP_Input' onSubmit='return checkAnswers1()'>";
txtGoal += "<%'strGoalPrefix="E.S1." %>";
txtGoal += "<%strGoalPrefix=strGoalCategory%>";
txtGoal += "<%strGoalDot="."%>";
txtGoal += "<strong>";
txtGoal += "<%response.write(strGoalPrefix)%>";
txtGoal +="<%Set objRS = Server.CreateObject("ADODB.Recordset")%>";
txtGoal +="<%objRS.Open "SELECT GoalNum FROM AMS_StrategicPlanGoal WHERE left(GoalNum,5) = 'E.S1.';", objConnection, 2, 2 %>";
txtGoal +="<%If Not objRS.EOF Then%>";
txtGoal +="<%aTable1Values = objRS.GetRows()%>";
txtGoal +="<%objRS.Close%>";
txtGoal +="<%set objRS=nothing%>";
txtGoal += "<input type='hidden' name='strGoalCategory' id='strGoalCategory' value='<%=strGoalCategory%>'>";
txtGoal += "<select name='strGoalNum_goal_line' id='strGoalNum_goal_line' onchange=goal_change1(this)>";
//action
var newCell2 = row.insertCell(2);
txtAction += "<input name='strGoalCategory2' type='hidden' value='E.S2.'>";
txtAction += "<input name='strGoalCount' type='hidden' value='<%=strGoalCount%>'>";
txtAction += "<input type='submit' name='frmSaveLine' value='Save Line'>";
txtAction += "<br>";
txtAction += "Note: This action will save all records in this goal.";
txtAction += "</form>";
newCell2.innerHTML = txtAction;
newCell2.style.verticalAlign = "top";
}
<table>
<tr>
<form>
<td>...</td>
<td>...</td>
<td>...</td>
</form>
</tr>
</table>
<table>
<form>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</form>
</table>
<table>
<tr>
<td>
<form>
<table>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<form>
<table>
<tr>
<td>...</td>
<td><input name="rowId1_strGoalCategory" ...></td>
<td><input type="submit" name="frmSaveLine_rowId1" ...></td>
</tr>
<tr>
<td>...</td>
<td><input name="rowId2_strGoalCategory" ...></td>
<td><input type="submit" name="frmSaveLine_rowId2" ...></td>
</tr>
</table>
</form>
<table>
<form>
<tr>
<td>
I was wondering if wrapping the <tr>...</tr> in a form is valid markup?
<!ELEMENT TABLE - -
(CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
<!ELEMENT TBODY O O (TR)+ -- table body -->
<!ELEMENT TR - O (TH|TD)+ -- table row -->