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

Database Paging and Checkboxes

Status
Not open for further replies.

rtgordon

Programmer
Jan 17, 2001
104
US
I am trying to implement a solution similar to what best buy and many others use. I have many pages of results displayed each with checkboxes. The user can select several items and then click compare to compare the checked items. I currently have this working with javascript, but only for the current page. I need for the user to be able to check boxes on multiple pages and go back and uncheck boxes before comparing the items.

I just want to determine the best way to approach this. I am thinking that using session variables will help, but I am not sure about a couple of things.

So, for starters, what is the best way to approach this one?

Thanks!

gordon
 
If pages have enabled session state, and cookies are required in order to view a site - use session.

Also think about how to store list of checked items (delimited string, array and dictionary are some of options), and how to make these generic functionalities:

- add item to checked list
- remove item from checked list
- check if specified item is already on the list
 
Thanks for the propmt reply!

these are some of the things i have been thinking about. When the page is loaded,
If I have an array or string with values,
I check my array or string to see what values are in there and if any match the current page,
I set the appropriate checks in the corresponding boxes,

If I go to another page,
I take all the boxes I selected and add them to my array or string,

If I submit,
I go to the compare page,
I take the list and add last checked items,
I process results.

My main stumbling point is that when I submit the page, It goes to an existing page and is expecting all of the sku's to be in a formatted string.

Secondly, how do i go about linking to another page, and passing the checked value in if the page I am linking to is different than the form submission page? I mean I have two pages. partlist.asp and partcompare.asp partlist calls itself with a dynamic page number and when the user clicks compare, the form is submitted to the comparison page.


 
i suppose i could have the form page submit to itself,
build the session string/array,
check to see if the user clicked compare

if the user clicked compare,
redirect to the compare page,
pull the values from the session

This would work I think, but it doesn't seem like the best method. Any better ideas?

Thanks!
gordon


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top