ceeleelewis
Programmer
I have a interesting (an important question that will have an impact on my form design)question I'd like to pose... Is there a way for me to display/update checkboxes in a form using ADO even if I have a value in the checkbox field?
From what I understand so far. Any Request.Form collection will show no value (.. in my case "False" that is produced from the form checkbox(es).
breif example:
form.asp........
'===========================================
'The Following Code Just References fields of the recordset
'===========================================
<% If Not RScm_checklstitem.EOF then
xDNS = RScm_checklstitem("DNS"
xPASSWORD = RScm_checklstitem("pssWrd"
xDISK_SPACE = RScm_checklstitem("chDksp"
xSHARED_MEMORY = RScm_checklstitem("shMem_pre"
xDETERMINE_APPLICATIONS = RScm_checklstitem("dtAppsdb"
xSEND_MONITORING_TEMPLATE = RScm_checklstitem("sndMrt"
end if
%>
'===============================================
'end references
'===============================================
<table width="96%" height="354" border="0" cellpadding="0">
<tr>
<td width="266" height="69" align="right" nowrap bgcolor="#E6E6E6"><font size="2" face="Arial">Is
system in DNS : </font></td>
<td width="67"> <table border="1" width="11%" cellspacing="0" bgcolor="#FFFFFF" bordercolorlight="#cccccc" bordercolordark="#cccccc">
<tr>
<td width="100%" ><input type="checkbox" onClick="itemCheck(this.form.PreInstall)" name="DNS" value="<%=xDNS%>"/></td>
</tr>
</table></td>
</tr>
<tr>
<td width="266" height="54" align="right" nowrap bgcolor="#E6E6E6"><font size="2" face="Arial">Obtain/verify
passwords: </font></td>
<td> <table border="1" width="10%" cellspacing="0" bgcolor="#FFFFFF" bordercolorlight="#cccccc" bordercolordark="#cccccc">
<tr>
<td width="100%" ><input type="checkbox" onClick="itemCheck(this.form.PreInstall)" name="pssWrd" value="<%=xPASSWORD%>"/></td>
</tr>
</table></td>
</tr>
then I have my processing page.........
'===========================================
'The asp page processes info from form than updates db
'===========================================
If Request.Form("Update" = 1 Then
'response.write"6" If Request.Form("sndMrt" = "" Then
%>
<p align="Center">
<font color="#FF0000">Error.</font><br><br> Send Monitoring Requirements Template Field Cannot Be Empty. <br/><br />
Please Check Field Then Repost Form.
<br>
<a href='#1' onClick='history.back()'>Back</a>
</p>
<%
response.write(Request.Form("DNS")
response.write(Request.Form("pssWrd")
response.write(Request.Form("chDksp")
response.write(Request.Form("shMem_pre")
response.write(Request.Form("dtAppsdb")
response.write(Request.Form("sndMrt")
Else
'Update the database
'objRS("reqFormId" = Trim(Request.Form("reqFormId")
'objRS("reqDate" = Trim(Request.Form("reqDate")
objRS("DNS" = Trim(Request.Form("DNS")
objRS("pssWrd" = Trim(Request.Form("pssWrd")
objRS("chDksp" =Trim(Request.Form("chDksp")
objRS("shMem_pre" = Trim(Request.Form("shMem_pre")
objRS("dtAppsdb" = Trim(Request.Form("dtAppsdb")
'objRS("dtPefped" = Trim(Request.Form("dtPefped")
objRS("sndMrt" = Trim(Request.Form("sndMrt")
objRS.Update
response.redirect("ccDetails.asp"
'Dim lsURL
' Obtain the URL from the QueryString
'lsURL = Request.QueryString(CheckListPre.asp("PreInstall")
' Redirect back to previous form
'Response.Redirect(lsURL)
'Check for errors in objConn
'subErrorCheck
%>
<p align="Center">
Your update has been processed succesfully.<br><br>
<a href="CheckListInstall.asp?Install=<%=Request("RecID"%>">Proceed to Installation</a> <a href="commandopenreqmngr.asp">Return to Open Requests</a><br />
</p>
<%
End if
End if %>
From what I understand so far. Any Request.Form collection will show no value (.. in my case "False" that is produced from the form checkbox(es).
breif example:
form.asp........
'===========================================
'The Following Code Just References fields of the recordset
'===========================================
<% If Not RScm_checklstitem.EOF then
xDNS = RScm_checklstitem("DNS"
xPASSWORD = RScm_checklstitem("pssWrd"
xDISK_SPACE = RScm_checklstitem("chDksp"
xSHARED_MEMORY = RScm_checklstitem("shMem_pre"
xDETERMINE_APPLICATIONS = RScm_checklstitem("dtAppsdb"
xSEND_MONITORING_TEMPLATE = RScm_checklstitem("sndMrt"
end if
%>
'===============================================
'end references
'===============================================
<table width="96%" height="354" border="0" cellpadding="0">
<tr>
<td width="266" height="69" align="right" nowrap bgcolor="#E6E6E6"><font size="2" face="Arial">Is
system in DNS : </font></td>
<td width="67"> <table border="1" width="11%" cellspacing="0" bgcolor="#FFFFFF" bordercolorlight="#cccccc" bordercolordark="#cccccc">
<tr>
<td width="100%" ><input type="checkbox" onClick="itemCheck(this.form.PreInstall)" name="DNS" value="<%=xDNS%>"/></td>
</tr>
</table></td>
</tr>
<tr>
<td width="266" height="54" align="right" nowrap bgcolor="#E6E6E6"><font size="2" face="Arial">Obtain/verify
passwords: </font></td>
<td> <table border="1" width="10%" cellspacing="0" bgcolor="#FFFFFF" bordercolorlight="#cccccc" bordercolordark="#cccccc">
<tr>
<td width="100%" ><input type="checkbox" onClick="itemCheck(this.form.PreInstall)" name="pssWrd" value="<%=xPASSWORD%>"/></td>
</tr>
</table></td>
</tr>
then I have my processing page.........
'===========================================
'The asp page processes info from form than updates db
'===========================================
If Request.Form("Update" = 1 Then
'response.write"6" If Request.Form("sndMrt" = "" Then
%>
<p align="Center">
<font color="#FF0000">Error.</font><br><br> Send Monitoring Requirements Template Field Cannot Be Empty. <br/><br />
Please Check Field Then Repost Form.
<br>
<a href='#1' onClick='history.back()'>Back</a>
</p>
<%
response.write(Request.Form("DNS")
response.write(Request.Form("pssWrd")
response.write(Request.Form("chDksp")
response.write(Request.Form("shMem_pre")
response.write(Request.Form("dtAppsdb")
response.write(Request.Form("sndMrt")
Else
'Update the database
'objRS("reqFormId" = Trim(Request.Form("reqFormId")
'objRS("reqDate" = Trim(Request.Form("reqDate")
objRS("DNS" = Trim(Request.Form("DNS")
objRS("pssWrd" = Trim(Request.Form("pssWrd")
objRS("chDksp" =Trim(Request.Form("chDksp")
objRS("shMem_pre" = Trim(Request.Form("shMem_pre")
objRS("dtAppsdb" = Trim(Request.Form("dtAppsdb")
'objRS("dtPefped" = Trim(Request.Form("dtPefped")
objRS("sndMrt" = Trim(Request.Form("sndMrt")
objRS.Update
response.redirect("ccDetails.asp"
'Dim lsURL
' Obtain the URL from the QueryString
'lsURL = Request.QueryString(CheckListPre.asp("PreInstall")
' Redirect back to previous form
'Response.Redirect(lsURL)
'Check for errors in objConn
'subErrorCheck
%>
<p align="Center">
Your update has been processed succesfully.<br><br>
<a href="CheckListInstall.asp?Install=<%=Request("RecID"%>">Proceed to Installation</a> <a href="commandopenreqmngr.asp">Return to Open Requests</a><br />
</p>
<%
End if
End if %>