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
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.
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:
I have a section where users can add their 'favourite venues' to a list. This is stored in a column in the users table, for example:
10,8,1,18,26
On the user area I can do a select drop-down with all their favourite venues easy.
When I try to use the same (slightly modified) code on the venue detail page to determine whether the user has the venue in their favourite to link either to ADD venue (not currently a fave) or REMOVE venue (already on the faves list) it only recognises the last added venue, i.e. (working on the list above) venue #26.
I am looking for a function to split my string into subsequent parts. I am having a textbox from where user can enter more then one numbers (23, 456, 89, 394 etc), and now I want to write a function which return this sting into this fashion i.e.
i am trying to split an email address into a string.Basically, what i wanna do is take the first part of the email just before the "@" symbol and insert it into the database. How can I do this using asp?
The number '60' can be written as (50+10) or (25+35) or (15+45) or (7+53) etc... but I want the output as (50+10) only when 60 is typed in a textbox & the Form is submitted. How do I do this?
I have a textbox that will have this kind of value. eg. 1+1, 1+2, 1 +2, 1 + 2.....
So now i need to get the 1 and 2 to add it up. This textbox is for add function.
Before this i using the Mid Function. But this is only work if they entered btwn 1 - 9. If 10 then unable to find it.
I remember there is a function where it will find the value then stop at there. then i only grab the bfore the value. I try to lookup but i can't find the function. I need to get the value bfore + and after + to add it up.
I have an array which I split and then add the values into a table. In total there are 3 values in the array, two integers and one string. The integers are put smoothly but the string is not. Is it possible to add the string?
how to do the following. Split a string var at each separate leter and then make an array out of it in asp(vb script). jump the cursor between textboxes automatically.
i.e tpye one letter into input field with a max length of 1 and then automatically tab to the second. The end result being able to type a whole word without looking up but still have the letters separated.