category drop downs - how to specify category upon

Results 1 to 2 of 2

Thread: category drop downs - how to specify category upon

  1. #1
    Join Date
    Dec 1969

    Default category drop downs - how to specify category upon

    I have a form where someone can fill in info and select a particular category from a drop down menu. The drop down menu is populated from my category table and simply passes a number depending on which category they choose. One problem is how do I put in the specified category on the update form. For example, say someone specified the category "Motorcycles" which puts the categoryID of 2 in the info table. If they want to edit their motorcycle, on the update page the same drop down list appears, but I need it to automatically have Motorcycle selected in that drop down list instead of the first entry. Thanks a lot!!!

  2. #2
    SPG Guest

    Default RE: category drop downs - how to specify category

    Well the real question is "Where do you get your list from?"<BR><BR>I would guess that you&#039re getting your list out of the database. This is because it makes life easy.<BR><BR>foo = request.form("selectedNumber")<BR>do while not objRS.eof<BR> if cInt(objRS("Number")) = cInt(foo) then<BR> response.write "&#060;option selected value=" & objRS("number") & "&#062;" & objRS("Name") & "&#060;/option&#062;"<BR> else<BR> response.write "&#060;option value=" & objRS("number") & "&#062;" & objRS("Name") & "&#060;/option&#062;"<BR> end if<BR> objRS.moveNext<BR>loop<BR><BR><BR>It&#039s hardly an optimal solution, but hopefully you get the general idea...

Posting Permissions

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