473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Classic ASP how to check a checkbox

Hello,
I am working on some ancient code and am having a ton of issues try to figure out how to do some of the simplest thing with the classic asp.

I have made an asp page that pulls data from the database and then creates some checkboxes. I then add it to the inside of a table like so:

Expand|Select|Wrap|Line Numbers
  1.     <%while not fieldNames.EOF%>
  2.     <tr>
  3.         <td><font size="1"><b><%=Trim(fieldNames.Fields.Item("FieldName").Value)%></b></font></td>
  4.         <td>
  5.             <center><input name="<%=Trim(fieldNames.Fields.Item("FieldName").Value)%>" type="checkbox" /></center>
  6.         </td>
  7.     </tr>
  8.     <% fieldNames.MoveNext()
  9.          Wend%>
  10.  

I then need to go back and check any checkboxes that have a fieldName present in another DB table.

Currently I am trying to make the checkbox check but have been unable to here is the current code I am trying:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.     Dim checkBox
  3.     If not userFields.EOF then
  4.         while not userFields.EOF
  5.             set checkBox = userFields.Fields.Item("FieldName")
  6.                        'set checkbox = Request.Form(userFields.Fields.Item("FieldName"))
  7.             checkBox.checked = True
  8.             userFields.MoveNext()
  9.         Wend
  10.     End if
  11. %>
  12.  

No matter what I have tried I have not been able to check a simple checkbox..... PLEASE HELP!!!
Sep 17 '15 #1
0 3120

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Mike Lopez | last post by:
Hello. I need to set a checkbox to the "checked" state and prevent the user from unchecking it. I tried using "disabled", but then the value is not passed on the Post to an ASP page. Anyone...
2
by: Marcelo | last post by:
Greetings! I develop a multiple forms application in Microsoft Visual Studio C++ .NET 2003. I am working with a listView with checkBoxes and an event relative to the clicking of a checkBox in this...
1
by: .NETn00b | last post by:
Is this possible? I need to create a multi-select DataGrid, and I cannot use CheckBoxes. I want the selected rows to appear highlighted. One possible work-around that occurred to me was to...
6
by: hazz | last post by:
ICollection CreateDataSource() { dt.Columns.Add(new DataColumn("ReportInclude", typeof(Boolean))); for (int i=0; i<=10; i++) { dr = dt.NewRow(); dr = 0; dt.Rows.Add(dr); } void...
0
by: hazz | last post by:
The following code generates checkbox values from the database. Once the user selects/deselects checkbox values, is there a way to obtain the ID and Checkbox.Checked state from these BoundColumns...
9
by: morellik | last post by:
Dear all, I have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked. function tarInfo(info) { var i=0; var c=0;...
0
by: cvijaykrishna | last post by:
i am having a web based application and i am having a problem with it pls check it Explanationi am sending a sample code plese see it in VS-2005 FOR BETTER UNFERSTANDING I have a main page...
1
parshupooja
by: parshupooja | last post by:
Hey all, I have check box list on which is binded to one of the coulmn in table A. It is not bit column 40 50 60 70 In another table B have value in one row named like 40, 50, 60 etc While...
1
by: iderocks | last post by:
Hi All, I created a dynamic checkbox in ASP .Net inside a Button1_Click event method (outside the page_load event) and performed the event handling method for the CheckedChanged event and when I...
4
by: PeterVR | last post by:
Hello I'm not a programmer. I'm afraid my question will be hilariously easy to ASP.NET programmers. Actually, I hope it will be. Please help. In a .aspx file I'm trying to have a checkbox checked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.