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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a Web Page

Status
Not open for further replies.

flinchbot

MIS
Oct 9, 2002
4
0
0
US
Hi.

I'm sort of picking this up from the "Updating a Web Page" thread...

I have a Boolean field in my Access database. I'm mapping this to a checkbox. Two odd things happen:

1. The checkbox never updates according to the value sent to it from the Access database (Access send True or False, or at least that's what is received by the web page). How do I automatically check the box if True is sent from Access and uncheck it if false is sent from Access? Currently, it just ignores what's coming in from Access.

2. If I check the box and hit submit, my test update page shows that the checkbox is set to True. If I uncheck the checkbox and submit the form, the entire value for the checkbox is missing. Here is the code I'm using on my update.asp page to check the values being sent. The question is, how do I send a FALSE entry instead of it just plain not appearing?

<%For Each x In Request.Form %>
Request.Form( <%= x %> ) = <%= Request.form(x) %> <BR>
<% Next %>


Thanks for any help. This *should* work since it is receiving a True/False from Access. Grrrrrrr.
 
Got it. Here is the line to check the checkbox:

<input type=&quot;checkbox&quot; name=&quot;bNews&quot; value=&quot;Yes&quot; <%if FP_FieldHTML(fp_rs,&quot;bNews&quot;) = &quot;True&quot; Then %> checked <%end if%>>

Now, the next problem is that if the checkbox is left &quot;unchecked&quot; then that info is not passed to the post form. The fix for that is to go into More Options on Step 4 of the Database Connection Wizrd, pick more options, and set a default value of 0 for that checkbox field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top