Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display/Update html form check boxes...

Status
Not open for further replies.

ceeleelewis

Programmer
Sep 26, 2002
45
US
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(&quot;DNS&quot;)
xPASSWORD = RScm_checklstitem(&quot;pssWrd&quot;)
xDISK_SPACE = RScm_checklstitem(&quot;chDksp&quot;)
xSHARED_MEMORY = RScm_checklstitem(&quot;shMem_pre&quot;)
xDETERMINE_APPLICATIONS = RScm_checklstitem(&quot;dtAppsdb&quot;)
xSEND_MONITORING_TEMPLATE = RScm_checklstitem(&quot;sndMrt&quot;)
end if
%>
'===============================================
'end references
'===============================================
<table width=&quot;96%&quot; height=&quot;354&quot; border=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;266&quot; height=&quot;69&quot; align=&quot;right&quot; nowrap bgcolor=&quot;#E6E6E6&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;>Is
system in DNS : </font></td>
<td width=&quot;67&quot;> <table border=&quot;1&quot; width=&quot;11%&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#FFFFFF&quot; bordercolorlight=&quot;#cccccc&quot; bordercolordark=&quot;#cccccc&quot;>
<tr>
<td width=&quot;100%&quot; ><input type=&quot;checkbox&quot; onClick=&quot;itemCheck(this.form.PreInstall)&quot; name=&quot;DNS&quot; value=&quot;<%=xDNS%>&quot;/></td>
</tr>
</table></td>
</tr>
<tr>
<td width=&quot;266&quot; height=&quot;54&quot; align=&quot;right&quot; nowrap bgcolor=&quot;#E6E6E6&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;>Obtain/verify
passwords: </font></td>
<td> <table border=&quot;1&quot; width=&quot;10%&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#FFFFFF&quot; bordercolorlight=&quot;#cccccc&quot; bordercolordark=&quot;#cccccc&quot;>
<tr>
<td width=&quot;100%&quot; ><input type=&quot;checkbox&quot; onClick=&quot;itemCheck(this.form.PreInstall)&quot; name=&quot;pssWrd&quot; value=&quot;<%=xPASSWORD%>&quot;/></td>
</tr>
</table></td>
</tr>
then I have my processing page.........

'===========================================
'The asp page processes info from form than updates db
'===========================================

If Request.Form(&quot;Update&quot;) = 1 Then
'response.write&quot;6&quot; If Request.Form(&quot;sndMrt&quot;) = &quot;&quot; Then
%>
<p align=&quot;Center&quot;>
<font color=&quot;#FF0000&quot;>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(&quot;DNS&quot;))
response.write(Request.Form(&quot;pssWrd&quot;))
response.write(Request.Form(&quot;chDksp&quot;))
response.write(Request.Form(&quot;shMem_pre&quot;))
response.write(Request.Form(&quot;dtAppsdb&quot;))
response.write(Request.Form(&quot;sndMrt&quot;))
Else
'Update the database
'objRS(&quot;reqFormId&quot;) = Trim(Request.Form(&quot;reqFormId&quot;))
'objRS(&quot;reqDate&quot;) = Trim(Request.Form(&quot;reqDate&quot;))
objRS(&quot;DNS&quot;) = Trim(Request.Form(&quot;DNS&quot;))
objRS(&quot;pssWrd&quot;) = Trim(Request.Form(&quot;pssWrd&quot;))
objRS(&quot;chDksp&quot;) =Trim(Request.Form(&quot;chDksp&quot;))
objRS(&quot;shMem_pre&quot;) = Trim(Request.Form(&quot;shMem_pre&quot;))
objRS(&quot;dtAppsdb&quot;) = Trim(Request.Form(&quot;dtAppsdb&quot;))
'objRS(&quot;dtPefped&quot;) = Trim(Request.Form(&quot;dtPefped&quot;))
objRS(&quot;sndMrt&quot;) = Trim(Request.Form(&quot;sndMrt&quot;))
objRS.Update
response.redirect(&quot;ccDetails.asp&quot;)
'Dim lsURL
' Obtain the URL from the QueryString
'lsURL = Request.QueryString(CheckListPre.asp(&quot;PreInstall&quot;))
' Redirect back to previous form
'Response.Redirect(lsURL)
'Check for errors in objConn
'subErrorCheck
%>
<p align=&quot;Center&quot;>
Your update has been processed succesfully.<br><br>
<a href=&quot;CheckListInstall.asp?Install=<%=Request(&quot;RecID&quot;)%>&quot;>Proceed to Installation</a> <a href=&quot;commandopenreqmngr.asp&quot;>Return to Open Requests</a><br />
</p>
<%

End if

End if %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top