Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check boxes and arrays

Status
Not open for further replies.

craigward

Programmer
Nov 13, 2007
230
GB
Hi,

This might be a simple one, but i am all out of ideas.
I am calling data from a contact table in my sql express database. There are 5 pages of results being displayed, and each page has 20 results.

Next to each result is a checkbox that hold the uniqueid for that contact,this is done using a do while loop in classic ASP / HTML.

What i am doing is,checking a few boxes on the first page and clicking the next link to see the next 20 results, and again picking a random few. Each time you click the next page link the i am taking the uniqueid's and storing them in a session variable. ready to put in the database.

PROBLEM:

The problem is, once i get to the second page to select the next x amount of records, my Session("results") variable looks like this:

uniqueid, uniqueid, uniqueid, uniqueid

Which i great because i can use the split function and an array to break them up an insert them into my table. When i submit the second page to build up the uniqueid's into my session var i get this:

page one's values:

uniqueid, uniqueid, uniqueid, uniqueid

page two's values:

uniqueid, uniqueid, uniqueid

The issue thats breaking my logic is when i concatenate page one and page two's values the last uniqueid of page one and the first uniqueid of page 2 do not have a comma separating them, so my splitting of the uniqueid's in my array where a comma exists causes me an issue.

I know thats a long one, but any ideas would be really help full.

Thanks
 
when i concatenate page one and page two's values
How did you that ?
Like this ?
newvar = oldvar1 [!] & ", " [/!] & oldvar2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi,

Yea, thats what i did, but the problem was there was always one comma left, this i have resolved by using a trim function. for a minute i was really happy!!!

But then i hit the biggest brick wall.... My array splits my string every time it hits a comma, which worked well but i didn't see that most of my uniqueid's contain commas :p

when multiple check boxes are ticked and passed to a session var, they default to using a comma to separate the values.

Don't suppose anyone knows how i can dictate what character is used to do this?


Thanks
 
what character is used to do this
To do WHAT ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your help, i managed to resolve it, usin gth ereplace function.
 
Next time feel free to post your actual code in order to get appropriate reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top