urko wrote:
However I always get same ID for both items on compare page. Tip would be great, how should I solve that.
|
That sounds like it may be a probelm with the data being passed to the compare page. I'd do the compare page as a formhandler for the drop-down on the first page. Include the original ID as a hidden field, and the ID you want to compare it to as another field. On the compare page, it might be easier to debug if you used a separate call to the db for each ID store the results in an array and build the comparison page from the array
urko wrote:
Also I need to have to list to select from Example: list 1: Names of items list 2: Colour of item
|
Kind of depends upon how you need to have the two lists work.
If the user can select by Name
OR by Color, just pass separate fields to the formhandler/compare page. The one that's populated determines how the db call is done.
If the User can select by Name
AND by Color, it gets more comlocated depending upone wether or not all Names can have the same Colors to choose from of if each Name can have a different Color.
If all Names use the same set of Colors, just pass Color as an additional field to the formhandler/compare page.
If each name can have a different set of colors, you'll need to use javascript to polulate the color field based upon what's selected in the Name field. Validate the selection in the formhandler/compare page script.
Javascript is not reliable though. Many people have it disabled. so you may choose to set things up so when a Name is selected, the form is submitted and returns to itself with the color selection field populated from the DB.
urko wrote:
How should I write in recordset so that each user can add to his list only lets say 20 items? and if they add 21st item they'll get javascript message.
|
See the note above about javascript not being a reliable tool for validation.
If your users are registered, add a table keyed by user id to maintain a users list.
If your're users are not registered, add the same table but key it to a cookie id.
You'll find yourself using that table a lot to pull reports about your users preferences.