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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript and check boxes

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



 
? Not sure this is a javascript question. Why can't you add a comma with a simple concatenation statement?

----
star.gif
 
Your right, at the time i waslooking at the javascript section... Should be in VB Script, i will move it.

The reason a simple concatination doesn't work, is because the extra comma i add is always there at the end of the string, and that breaks it when i put it in to the array.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top