I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two'
So the sql looks like Delete From Table Where Field='one, two';
How do i do it in such a way that it becomes:
Delete From Table Where Field='one';
Delete From Table Where Field='two';?
I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two' so the sql looks like Delete From Table Where Field='one, two';
I have two records pulled from the same field in a table, so it would look like this
NAMES (Field name) John (forename) Smith (surname) There will always be 2 records
I need to take both these records and split them into two variables - one for the forename and one for the surname - (I need to insert these values into SQL statement)
Have tried the following code 'firstname' contains both the first and second name.
I am creating an application in ASP (old school ASP not .NET) and VBSCRIPT connecting to a SQL Server 2000 back end. There is a form on my webpage that has a select box in which <option> tags allow users choose a document type.
Once the document type is determined it is sent off as a parameter in a stored procedure on the databse. The recordset returned holds the values that are required to go in another set of options boxes.
(the next set of option box values depend on the query results). I know it sounds easy...I mean I know how to do it if it where on 2 seperate pages (thats easy) where it passes on the info...but this is for ONE asp page.
I'm having trouble getting a certain value out of my database. Code:
reportID = Request("reportID") sql = "SELECT * FROM reports WHERE reportID =" & reportID set rs=Server.CreateObject("ADODB.recordset") set rs=conn.execute(sql)
I can get every value I want out except for one, rs("courses"), which is a text field that is filled from a multiple select form that enters the ID numbers of courses. The thing is, when I check the actual Access db file, I can see the value there (e.g: 1, 2, 3), but when I try to print it to my page (e.g: <% = rs("courses") %>),
I get nothing. I can't figure out why it won't work especially as I have an identical field in another table which I can get the value for using exactly the same method. Anyone have any idea what could possibly going wrong?
I first retrieve the values stored in a session variable (where I have stored an array). Then I assign the session variable to a local array called "myarray".
Assume that "myarray" now contains 5 records. What would the code look like if I want to create a loop that transfers the 5 values from "myarray" into a select box/dropdown list?
I use a multi-select menu in an ASP so the user can pick several values.
<select multiple name="lbErrorType" size="12">
However, after I have saved the records to the DB, and the user comes back to edit a prior record, I re-populate the multiple select box and do a "<option selected>" for each record that is saved to the DB.
<option selected>
But only the last value is selected !?!?
How do I get the select menu to select ALL the appropriate values ?
My users have to select an value from a fixed selection of values. The obvious choice of control for such a requirement is to use a <select> (i.e. a combo box).
My problem is that sometimes, these combo boxes will have a *large* number of values. There could be any number of values in them from 5 to 5 million (unlikely it would be this large but possible).
Obviously 5 million is far too much to populate a <select> control with. Does anyone have any suggestion as to how a user could select a value from a *potentially* very large selection of values (i.e a suitable alternative to the <select> control)?
I'm having problems retrieving all the values from a multiple selection field using the freeaspupload component.
I'm creating an online email app that uses the freeaspupload to add attachement functionality, which means the form encoding type is multipart/form-data. I've done something similar with the persits aspupload component, and had no problems with that, but the freeaspupload version seems to handle <select> fields slightly differently. Code:
I am trying to learn and use good DHTML concepts and code (assuming they are needed). My current issue concerns how to handle this situation.
I have a Select List box which displays values based on what value is selected in a dropdown list. For example, my dropdown list contains a class name, and the Select list contains all of the students who are registered for that class.
So what I would like to occur, is when the user changes the class from the dropdown box, the Select List is re-created displaying the students who are enrolled in that class.
I thought I could do this without having to reload the page (with DHTML) but here is my problem. Code:
I am having a problem with getting my date to display in the format needed. The date is being called up from a database in the form of the date and time but I need to have the them both seperate from each other. Its for a message board app I'm currently developing. I've tried various methods but none have worked so far. I am using this code at the moment:
I have a var with the value of ADED I want to be able to break this var into an array of 4 elements, or it could be three, depending on the value of the variable. I tried the following but got nothing. Code:
dim strVar, arrVar strVar = Request.QueryString("strVar")
i need to write a query that splits forname and surname that are held in the same col of a db eg old form requested for name(so users just put sarah smith) but I have added another col forname in the db and the forms now collect forname and surnane into seperate field but I have to now split the old data and put ot into the separate fields can anyone point me in the right direction.
i get the querysting like this: www.abc.com?email=abc@abc.com phone=33333333 Now i want to split this string so that i can just pass the phone number to the variable in my program so that the fax gets going.
Can you please let me know how i can split this string and just get the phone number to be passed to the variable ,so that i can initialte the next function of send fax?
Has anyone had the misfortune to try and split a querystring that has x duplicate name/value pairs within the querystring? I have tried every sort of combination to do this and it continues to just run through the whole querystring.
here is an example querystring
URL
The Address values, email values, title values are fine as they are named on the previous page. The problem is, the L1, L2, L3, L4, L5 etc are dynamically named from a db depending on what the user selects on a previous page and can be duplicated up to 6 times, depending on how many different locations they have. I am able to get all the values at once, but need to be able to split the duplicated name/value pairs as they at seperate locations.
basically what i have done is taken a date and time, split them apart, took the date array split that into 3 times via the / seperator now im trying to split the day number into 2.
(i.e if the day is 12 for example i want to split it so i get both 1 and 2 seperate, or if the day is 08 i would want to get 0 and 8 seperate).
Is there a way to split a number without some sort of seperator so i can get the first and second number of the day and if possible how?
I've made my first ASP website that interacts with a detabase. All fairly standard: it can display the entire contents of the db, you can input new items, update and delete items, and I've just started making a search page...[!] It all works fine if the user just searches with one word, but if they enter more than one word and then press search, I don't know how to split their searchstring up into [an array of?] different strings to search the db with. Is this even the easiest way to do it, or am I just wasting my time?
I need to split a large amount of text into an array everytime there is an enter (meaning line down) what is the code for the delimiter i would use.. Example text Hello This is some sample text that needs to be put into an array by everytime we go to the next line
I want to save a list of values in a cookie. I already use 1 key of the cookie to save the username. What I want to do is save a list of values as one string by using some kind of separator character.
There may be any number of these values including none. What is a good character to use to separate values? What commands do i use to split a string on the separator character into several strings?
I have an array I want to split. This is the code I am currently using:Code:
<% dim aSelected aSelected = split(request.form("option"),",") for i = 0 to ubound(aSelected) response.write (aSelected(i) & ("<br>")) next %>
This splits the array no problem. The problem I have is that the different variables (if thats the word to use?) the array is holding is sentences that contain commas in themselves. So the split is splitting my sentences. How can I split the variables at the end of the sentences. (some sentences have periods some don't so I can't use the ".").
This ASP page is a page which has FAQ. Some of the FAQ have answers with line breaks.
Questions and answers are stored in the database
When I output the answer, it displays like one long line. Hence I have written a small function to render this answer with line breaks where ever there are line breaks in this db field.
I have a very long string statement that needs spltting down into smaller sections and segments. I know how to use the split() function, and it splits the string down into smaller sections, however when I try and split one of these smaller sections into segments it throws an error out. Firstly is it possible to keep splitting the same string again and again to break it down? If not does anybody know how I would go about breaking down the string?
I am about to show a text field from SQL7.0 database, but need to display x number of images spread out amongst the text!! Basically similar to how bbc.co.uk/news display news articles....
I am wondering the best way to do this...
I was considering splitting the text into variables and then to display these sections next to the images.
i have a search form that will only search the whole string when searching a query. i would like to have the search string split into separate words so that each word could be used as part of a single query. is there a simple solution to my question ?