Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - compare 2 items on page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

compare 2 items on page

 Post Reply Post Reply
Author
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Topic: compare 2 items on page
    Posted: 16 June 2006 at 6:47pm
How could I compare two different items on a page?

Example:

Lets say you're at page where item under ID 5 is shown. Now you have a link "compare" which points you to a diffrerent page.

On that page on left side you'll have item under ID 5 displayed.
Now on the right side I would like that users select from a list the item which they'll compare to the item already shown on left side.

Im not exactly sure how should I do this.
Urko
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 16 June 2006 at 8:23pm
Most of the online stores seem to display a list of similar products with check-boxes so you select the items you want to compare. A compare button then takes you to a page with a table where each item is a column and the relative comparison points are laid out as rows.

In your case, where it's just being compared to one other item, I'd have the comparison drop-down list on the first page where the original item was shown. Selecting an item from the comparison box there would take you to the third page where the comparison table is laid out. The second page doesn't seem necesary to me.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Posted: 17 June 2006 at 7:02am
Thanks dpyers..
However I always get same ID for both items on compare page.
Tip would be great, how should I solve that.

Also I need to have to list to select from
Example:
list 1: Names of items
list 2: Colour of item

One more question though....
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.


Edited by urko - 17 June 2006 at 7:57am
Urko
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 17 June 2006 at 3:36pm
Originally posted by urko 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
Originally posted by urko 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.
Originally posted by urko 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.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Posted: 17 June 2006 at 4:46pm
I have fixed first part "same ID" and found good article on macromedia website about list menus ( relationship between two lists )...I just need to look at it a little bit more so i'll understand how this works... Wink

Quote 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.

Ok i'll try to avoid javascript.
Thing is, users must be logged in my forum in order to use its list...First I tried to change buddy list to mylist...i have posted in modification forum about that., but I have made my own version and it's working great...

All I was thinking is to limit the records per user, so that user could only add 20 items ....like the Private message stuff, where admin decide how many PM can user have in its inbox...If they fill its box, they need to delete 1 or more in order to add new one.
Db is working ok, relations are made correctly, i just dont know what should I write and where to limit Mylist feature to 20 records per user.


Urko
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2006 at 6:35pm
I have found an article explaining how to limit the records per user, but for some reason I get an error all the time Object required

<% 
strSQL = "SELECT COUNT (*) AS Author_ID from tblMylinks WHERE Author_ID = " & lngLoggedInUserID & ";"
setObjRS = objConnection.Execute("strSQL")

If objRS ("Author_ID") = 10 then
response.write ("My text.... ")
End if %>



M i missing something??

Thanks


Edited by urko - 20 June 2006 at 6:36pm
Urko
Back to Top
urko View Drop Down
Groupie
Groupie
Avatar

Joined: 23 September 2004
Location: Slovenia
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote urko Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2006 at 7:22pm
I made it .
Urko
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2006 at 10:27pm
remove the quotes in:
objConnection.Execute("strSQL")

should be:


objConnection.Execute(strSQL)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.