I am developing this web application where users may go through a number of steps to "build their product". This is all done with session variables to hold the input until submitted. The way I have it right now,
There is about 16 checkboxes, all with the same name "checkbox" (for simplicity) Each has a different id and different value.
The user may only choose 3. The values from these get stored in a comma deliminated string: ie. about, testimonies, services.
(I am trying to avoid setting a variable for each checkbox to be equal to, which I tried and it didn't work.)
If the user goes back to the page if they change their mind I want the appropriate checkboxes to be checked.
Right now I have the string being split up into an array. I have tried setting the array values to variables, then I tried setting these equal to another specific variable only for that checkbox..blah,blah, blah.
Here is my code, very similar to someone's on the forums (which I have been going through with a fine tooth comb, ; turns out their thread was never answered).
This code gets the first array item and checks the right checkbox but no the other 2.
<%
menuarray = Split(Session("checkbox"),",")
for i = LBound(menuarray) to UBound(menuarray)
'currentCardType = ""
response.write " " & i & " = " & menuarray(i) & "<br>"
next
' because there is only 3 for sure, I just used 0-2 rather than i for the following.
' I have the following three times in my code, for the 3. Tried it with just "i" and within the loop but didn't work
if CStr(menuarray(0)) = CStr("Welcome") then
vWelcome = "checked"
elseif CStr(menuarray(0)) = CStr("About Us") then
vAbout = "checked"
elseif CStr(menuarray(0)) = CStr("Message from the President") then
vMessage = "checked"
elseif CStr(menuarray(0)) = CStr("Products and Services") then
vProducts = "checked"
elseif CStr(menuarray(0)) = CStr("Our Services") then
vServices = "checked"
elseif CStr(menuarray(0)) = CStr("Curriculum") then
vCurriculum = "checked"
elseif CStr(menuarray(0)) = CStr("Testimonials") then
vTestimonials = "checked"
elseif CStr(menuarray(0)) = CStr("Student Life") then
vStudentlife = "checked"
elseif CStr(menuarray(0)) = CStr("Apply Now") then
vApply = "checked"
elseif CStr(menuarray(0)) = CStr("Case Studies") then
vCasestudies = "checked"
elseif CStr(menuarray(0)) = CStr("Catalog") then
vCatalog = "checked"
end if
how to create an array of checkboxes for a dynamic table. I want the checkboxes to display on the left of the table. When the checkbox is selected the user will select delete, edit, or update.
I'm developing a site in which I'm supposed to daily display an array of images into a table in a page. The question is : Is there any code in asp that could help me perform the splitting of the array and consequently displaying it in the tables along the pages, (considering the necessity of displaying it in more than one page) ,automatically ? The problem is that these arrays of images do not have a constant length, actually, I can read the content of items in a certain folder, before creating the array and, according to that number I should set it to be splitted in "x" pieces that should be displayed in "x" pages, within tables. If it was a fixed number of items I wouldn't have much trouble, but this number varies, daily.
I am having trouble loading the result of a VBscript split function into an array. The script is supposed to take the user's login name (the form for this is name separated by underscores such as john_foo or lisa_wilson), split it at the underscores, and load first, middle and last name into an array. The problem I keep getting though, is that I am getting a type mismatch error. Here is the code:
<%dim LogName, NameArray(), FirstName, LastName, MiddleName, LastPage 'Get NT authorized login info LogName = request.servervariables("logon_user") NameArray = Split(LogName, "_") for x = 0 to UBound(NameArray) response.write NameArray(x) & "<br>" next %>
The FirstName, MiddleName, LastName vars are supposed to take the array values later.
The selections in one of combo box is refreshed dynamically base on the customer id that is entered by the user. I would like to caupture all the information that has entered by the user before the page reloads and poputlate the page with all the data.
Is anyway that I can avoid using the parameters. Because there are too much of fields that I to pass through with the parameters.
This query sort on the basis of Lft and Rgt columns.
The name of the array is: aEmp.
My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.
Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.
In working with arrays, I have found that I am unable to dimension and array with a variable that has an integer value but I can redimension one this way. I haven't see any information that tells me if this is a requirement, although it appears to be because I get an error if I try it.
Ex.
Dim b b = 10 Dim a(b) ' this errors out but Dim a() ' this Redim a(b) ' works
I have a form that has checkboxes. I would like when the user clicks the process button the next page will display the value of the boxes that were checked.
To get the checked value of checkboxes I use this code: Code: For Each subitem In oFileUp.FormEx("imgCheckBox") ... Next How can I get the value of those unchecked checkboxes?
I am trying to set up a page, with some input fields, which are mandatory. Then there is a checkbox, when it is checked, the input fields do not need to be filled (not mandatory anymore). At the moment, even though the checkbox is checked it asks to fill the mandatory fields.
I've never used checkboxes in ASP, well nows the time i do it.Im creating a login script, and want the user to be able to click on "remember me"it keep them logged in.
how would i get that in ASP. how would i make it detect wether or not the checkbox has been selected or not?
I'm trying to create a form that has checkboxes on it that when a user checks the particular boxes, and submits the form, it performs the query based on the selections. I'm using MS Access and FrontPage. I'm having problems passing the information from the form to the query and then to the database.
How can I use checkboxes to send out an email based on which checkbox was clicked? For example, I have an html table that is constructed dynamically which contains information about events stored in a database.
The table has checkboxes out to the left side (similar to hotmail) and when I check however many boxes, and click submit, I want to send an email to each address that is associated with each record that I checked its box.Something like "for each checkbox clicked, select the ID and email address associated with it, and dispatch an email"
I have everything set up except the asp loop and select statement that will help me achieve this.
i have some 15 checkboxex on a form... i want to 1st check the no. of checkboxes that are checked?? and then loop it that many times adn insert the quantities the user enters in the text boxes.
do i need to group the checkboxes....hwo can i do that??? how to know which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th are checked then i 1st need to get the id from the database adn then based on htat id retrieved i need to insert values on another table.
I've been using Dreamweaver to develop some simple database connectivity. So far everything works, but could be more user-friendly and flexible.
I have an Access database with 4 document types. I have search forms which allow users to enter a keyword and search for one specific document type. The problem is I need four different search forms this way. What I would like is to include 4 checkboxes and one keyword textfield. Code:
I have a series of dynamcially named and id'd checkboxes. each one has the same name but its id value is different. The ID value tells me which checkbox relates to a particular record in a recordset. I need to obtain the id of the checkbox and its value - so far I can only get the value as follows :
<% For x=1 To request.form("BillNumCheckBox").Count aSelected = request.form("BillNumCheckBox").Item(x)
response.write x & " = " & aSelected & "<BR>" Next
One of my fields is the customer's social security number, all originally entered as a 9-character string. How can I split and display that into 3-2-4 format?
What I need to do is get the content of a text file, one line at a time, and break it up using , as a delimiter.
So far I can open the file and print out all the content, but all I am getting is a million ???????'s on the screen, and not the file. Here is what I am using: Code: