Multiple "database populated" select menus

Results 1 to 2 of 2

Thread: Multiple "database populated" select menus

  1. #1
    Join Date
    Dec 1969

    Default Multiple "database populated" select menus

    I have 3 drop-down select menus, all of which are populated by different records. Menus 2 and 3 rely on the previous selected menu value for its data. I initially wanted to have each menu updated without reloading the page, but now I'm trying to solve it with reloading. I've tried some javascript and a Recordset DTC, but it's still not working. Can someone point me in the right direction. Thanks

  2. #2
    Join Date
    Dec 1969

    Default Much more info required!!!

    Well for a start, I think that DTC&#039;s are a waste of time. They are just a device for making it easier for beginners to migrate from VB of other desktop programming systems.<BR><BR>That said, you have given no clues as to the reason for your problems. I am not even sure that posting your code would help a lot as DTC&#039;s just produce code-bloat, that can be difficult to decipher.<BR><BR>To populate one or ten select boxes, from a database is hardly any more difficult. To populate them progressively depending on user input, just requires some signals to be sent when the data is submitted to indicate what stage you at.<BR><BR>You could use a hidden field in your form to pass the stage info:<BR><BR>&#060;input type=hidden name=Stage value="&#060;%=Request.Form("Satge")%&#062;"&#062; <BR><BR>This hidden field would both pass the new latest stage value and retrieve the one from the previous page.<BR><BR>Now you would have an array of select boxes, and each select would have an onchange event-handler to set the Stage value and submit the current data:<BR><BR>&#060;select name=Select1 onchange="this.form.Stage.value=1;this.form.submit ();"&#062;<BR>&#039; Some kind of Recordset loop to loop thru and get values <BR>&#060;option value="&#060;%=OptValue%&#062;" &#060;%if Request.form("Select1")=OptValue then Response.write "selected"%&#062;&#062;&#060;%=OptLabel%&#062;&#06 0;/option&#062;<BR>&#039; -- end Recordset loop --<BR>&#060;/select&#062;<BR><BR>Then when you re-submit the the form it retrieves the current value for each select and the stage value. From the stage value it would decide which select list to filter. If Stage=1 then it would filter Select2, If Stage=2 then it would filter Select3, etc.<BR><BR>I suggest that you create a connection object, and open each select&#039;s recordset using the common connection.<BR><BR>Anyway I hope that I have not confused too much and that I have given you something to start with. For further details your questions should be more specific.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts