Splitting Values From A Select Box ?

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';?

View Replies


ADVERTISEMENT

Splitting Value From A Select Box?

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';?

View Replies View Related

Splitting Values From A Recordset

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.

Code:

View Replies View Related

Splitting Multi Select Item Into Arrays

I know that I can use instr(input,1) etc. but my attempts so far are of little use.

View Replies View Related

Select Distinct Values

Some values in my array are repeating. Is there a way to select distinct values from the script like you can in sql?

View Replies View Related

Select Box Option Values

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.

View Replies View Related

SQL Select Not Picking Up Values

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?

View Replies View Related

How Can I Transfer Values From An Array To A Select Box?

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?

How is that done?

View Replies View Related

Re-Selecting Values In Multi-select Menu

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 ?

View Replies View Related

Alternative To <select> For Large Number Of 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)?

View Replies View Related

Freeaspupload: Retrieving Multiple Values From A Select Field

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:

View Replies View Related

Refresh Values In Select List Based OnChange Of A Dropdown Box

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:

View Replies View Related

Splitting Up A Date

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:

<%Response.Write FormatDateTime(sectionRS("MesDate"), vbGeneralDate)%>

The result comes out the same as if no formatting is used. Do I need to create a variable for the value being called up from the database?

View Replies View Related

Splitting Arrays

I have a string that looks like this: a|b|c|d%e|f| ...

I split once on "%"

ar1 = Split(Mystring, "%")

then when I try and split the ar1 by

ar2 = Split(ar1, "|")

I get error '800a000d' Type mismatch

I have tried
ar2 = Split(Cstr(ar1), "|")

How can I split this string?

View Replies View Related

Splitting A String

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")

arrVar(0) = Left(strVar, 1)
arrVar(1) = Mid(strVar, 2, 1)
arrVar(2) = Mid(strVar, 3, 1)
arrVar(3) = right(strVar, 1)

When I try to response.write(arrVar(2)), i get nothing. What am I doing wrong?

View Replies View Related

Splitting Data

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.

View Replies View Related

Splitting 1 Column Into 2

Pretty basic but I cannot figure it out.

Column:
FULLNAME (lname, fname)

Needs to be

FNAME
LNAME

Should split at the comman.I already have all the columns created; just
need to SQL command to make it happen.

View Replies View Related

Splitting This String

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?

View Replies View Related

Splitting Time (00:00:00)

I have a variable that stores an amount of time in '00:00:00' format. It is a varchar in the database.

Is there a way to Split the value into hours, minutes, and seconds so I can add them?

I figure it would look something like

xx*60 + xx*60 + xx*3600? Or something like that?

View Replies View Related

Splitting A Querystring?

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.

so what i need to be able to do is

Location 1

L1 - 0
L2 - 1
L3 - 0
L4 - 0
L5 - 0

Location 2

L1 - 0
L2 - 2
L3 - 2
L4 - 0
L5 - 0

View Replies View Related

Email Related Splitting

This is the code I have so far:

I take the email address and split at the "@" symbol. Then I split at the "." sign to get the firstname and lastname.

Most of the times, the email address is of the format:

FirstName.LastName@company.com

However at times, the email address can be just firstname@company.com

At such instances the code fails, how do I check for the instance of . before I split it again?

View Replies View Related

Splitting Characters With No Seperator?

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?

View Replies View Related

Splitting Lines Of Code

if i wanted to split the below SQL statement on two lines, what would the
syntax be....

SQL = "UPDATE gallery WHERE g_id = " & Request.Form("g_id") &
"SET g_name = " &
Request.Form("g_name") &
"g_add = " &
Request.Form("g_add") "

View Replies View Related

Splitting Search String

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?

View Replies View Related

Splitting Text Into An Array

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

sample code

Array = Split(sampletext,?)

View Replies View Related

Saving And Splitting Strings

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?

View Replies View Related

Splitting Arrays With Sentences

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 ".").

View Replies View Related

Array And Splitting The Contents

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.

My code for the function is: ...

View Replies View Related

Splitting A Variable Into Parts

I have a variable named DressCode. The content of this variable is something like N040602
I want to split this variable into four parts:

DressCodea would be the N part
DressCodeb would be the 04 part
DressCodec would be the 06 part
DressCoded would be the 02 part

How do you do this is ASP, so it'll split the variable, no matter what the content is, as long as it is that format (ie 1 letter then 6 numbers).

View Replies View Related

Splitting Or Trimming A String

I am taking a field from a database and attaching it to avariable like so:

varID = rsCheckLogin("LogonID")

This is returning, for example, SA70.

I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?

View Replies View Related

Splitting A VERY Long String

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?

View Replies View Related

Splitting Text Fields

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.

Anyone else done this?

View Replies View Related

Splitting A String To Use Separate Words

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 ?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved