Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old September 23rd, 2003, 01:49 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what's image?

Reply With Quote
  #22 (permalink)  
Old September 23rd, 2003, 02:38 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Image is "waking up too early and making a post while still sleepy" for Imagine ;)

It should have read:

' Imagine Listbox users, called lstUsers
If Request.Form("lstUsers") <> "" Then
  SQL = SQL & " AND Users = '" & Request.Form("lstUsers") & "'"
End If

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #23 (permalink)  
Old September 24th, 2003, 12:37 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yes, you need to save the state of the selected list boxes.

But like I explained in my previous post, you can retrieve the state from the currently selected it. Here's the basic flow again for just one single drop-down:

1. You create a drop-down which is sent to the browser
2. The user selects an item and sends the page to the server
3. You retrieve the selected item using Request.Form("lstList")
4. When you recreate the drop-down, you use the previously chosen item to preselect that item in the drop-down
5. The user submits the form again
6. You retrieve the selected item
7. When you recreate the drop-down, you use the previously chosen item to preselect that item in the drop-down

And so on and on. As you can see, you can always retrieve the selected item from the drop-down, thereby saving its state.

If you press a "Clear" button, all you need to do is *not* preselect the item in step 4 and 7.

I suggest a couple if things to get this page to work ASAP:

1. Start a new page that just uses a single drop-down. No sort order stuff, etc, just a simple query, and a simple drop-down.
2. Once that works, and you see how it all fits together, add additional drop down.
3. The add your sorting stuff
4. Then add your paging stuff
5. Then expand your query so it retrieves what you need.

I think that when you follow these steps, at step 5 you should be able to understand what happens in your current page exactly, and you should be able to fix it.

Smaller pages also make it much simpler to post code on this forum. The pages you have posted so far are just to big to look through and understand completely without being able to run it (don't forget, I don't have your database and other pages here; all I can do is look at this post and see the code).

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #24 (permalink)  
Old September 24th, 2003, 05:33 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, IMO, it's an either / or situation.

Your user either selects a new filter criterion from one of your drop-downs or your user selects one of your navigation links.

When they select a new item from the drop-down, the page should reload automatically (using an onchange attribute on the <select> tag). When that happens, the navigation starts again at page 1 because the criteria have changed.

When they click one of the navigation links, the values for the drop-downs should already have been preserved in the QueryString. As long as they click the nav links, the drop-downs should remain at their selected values, as those should be retrieved from the QueryString, and not from the drop-down itself.

Does this make sense?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #25 (permalink)  
Old October 1st, 2003, 08:54 PM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi imar, i got it. ;p thanks for ur help :)

i used session and a if- else to either pass either the string(href) or the form to a variable.

i also changed the if statement of the listbox, checking if the string isnull instead of just form isnumeric.

:D
Reply With Quote
  #26 (permalink)  
Old October 2nd, 2003, 01:38 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Great. Glad it finally worked. I think you have proven that maintaining someone else's code is more difficult than creating your own ;)

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE 7 form select options harpua HTML Code Clinic 0 May 9th, 2007 11:59 PM
Document.form can't find Label bekim Javascript How-To 1 February 13th, 2006 07:39 PM
Print Word document from Access Form ppenn Access VBA 2 December 14th, 2005 07:51 AM
display word document in form collie VB.NET 2002/2003 Basics 1 September 12th, 2004 09:53 PM



All times are GMT -4. The time now is 08:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.