Please could somebody help out with Field “REQUIRED” Validation for looped (Multiple) Textbox (Field)
Here is my script:
<script language=”JavaScript” src=”ew.js”></script>
<script language=”JavaScript”>
<!– start Javascript
function EW_checkMyForm(EW_this) {
return true;
}
// end JavaScript –>
</script>
<form onSubmit=”return EW_checkMyForm(this);” action=”sampleedit.asp” method=”post”>
<p>
<input type=”hidden” name=”a” value=”U”>
<input type=”hidden” name=”key” value=”<%= key %>”>
<table border=”0″ cellspacing=”2″ cellpadding=”0″ bgcolor=”#FFFFFF”>
<tr>
<table width=”679″ height=”46″ border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<tr>
<td width=”83″ height=”79″ bgcolor=”#0099CC”><div align=”center”><font color=”#FFFFFF”><font size=”-1″><strong>Device
ID</strong></font></font></div></td>
<td width=”51″ bgcolor=”#0099CC”><div align=”center”><font color=”#FFFFFF”><font size=”-1″><strong>Set<br>
Point<br>
Pressure<br>
</strong></font></font></div></td>
<td width=”51″ bgcolor=”#0099CC”><div align=”center”><font color=”#FFFFFF”><font size=”-1″><strong>Found<br>
Pressure<br>
</strong></font></font></div></td>
<tr>
<%
table_name = “pressuredevice” ‘ Name of the sub table
newRecord = False
tkey = “‘” & replace(replace(key & “”,”‘”,”””),”[“,”[[]”) & “‘”
strsql = “SELECT * FROM ” & table_name & ” WHERE [FACILITYCOMPONENTID] =” & tkey
Set Rs = Server.CreateObject(“ADODB.Recordset”)
Rs.Open strsql, conn, 3, 3
If Rs.EOF Then
Response.write “Pressure Devices not Applicable!”
Else
If Rs.RecordCount > 0 Then
Record_Count = 0
Do While Not Rs.EOF
Record_Count = Record_Count + 1
If Record_Count > 500 Then Exit Do ‘ exit loop if returns more than 500 records, you can change this limit
‘Row created as records
‘ Get the field contents
x_DEVICEID = RS(“DEVICEID”)
x_SETPOINTPRESSURE = Rs(“SETPOINTPRESSURE”)
x_FOUNDPRESSURE = Rs(“FOUNDPRESSURE”)
%>
<tr id=”<%=Record_Count%>” name=”<%=Record_Count%>”>
<td class=”data” height=”58″ bgcolor=”#F5F5F5″><div align=”center”><font size=”-1″>
<input type=”text” name=”x_DEVICEID” value=”<%= x_DEVICEID %>” size=15 maxlength=10>
</font></div></td>
<td class=”data” bgcolor=”#F5F5F5″><div align=”center”><font size=”-1″>
<input type=”text” name=”x_SETPOINTPRESSURE” value=”<%= x_SETPOINTPRESSURE %>”size=6 maxlength=8>
</font></div></td>
<td class=”data” bgcolor=”#F5F5F5″><div align=”center”><font size=”-1″>
<input type=”text” name=”x_FOUNDPRESSURE” value=”<%= x_FOUNDPRESSURE %>” size=6 maxlength=8>
</font></div></td>
</tr>
<%
Rs.MoveNext
Loop
End If
End If
%>
</table>
<p> </p>
<p> </p>
<input type=”submit” name=”Action” value=”EDIT”>
</form>