Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Drop Down w/Multiple Selections

Drop Down w/Multiple Selections

Scheduled Pinned Locked Moved Web Development
questionhelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robby
    wrote on last edited by
    #1

    I have a drop down list - code is: APPMANAGER002 APPMANAGER004 APPMANAGER040 APPMANAGER078 APPMANAGER124 This list allows multiple selections. We all know that if I were to select both APPMANAGER002 & APPMANAGER078 from the list, that the results are passed as 002,078,etc. What needs to happen is this: If I select APPMANAGER002 from the list, I need to send an email to this person with a notification. I need to duplicate this for each selection from the list. How can I look at the results and perform this? For instance, if this did NOT allow multiple selections, I could simply do a "IF APPMANAGER=002 THEN...". Since my results may be a string of selections, the IF statement above wouldn't work because the results may be APPMANAGER=002,078. Since I have NO idea what combination of results I will get, how can I look at the results, and based on what's in the string, perform IF THEN statements? Does this make sense? Thanks for any help! Robby

    R J L 3 Replies Last reply
    0
    • R Robby

      I have a drop down list - code is: APPMANAGER002 APPMANAGER004 APPMANAGER040 APPMANAGER078 APPMANAGER124 This list allows multiple selections. We all know that if I were to select both APPMANAGER002 & APPMANAGER078 from the list, that the results are passed as 002,078,etc. What needs to happen is this: If I select APPMANAGER002 from the list, I need to send an email to this person with a notification. I need to duplicate this for each selection from the list. How can I look at the results and perform this? For instance, if this did NOT allow multiple selections, I could simply do a "IF APPMANAGER=002 THEN...". Since my results may be a string of selections, the IF statement above wouldn't work because the results may be APPMANAGER=002,078. Since I have NO idea what combination of results I will get, how can I look at the results, and based on what's in the string, perform IF THEN statements? Does this make sense? Thanks for any help! Robby

      R Offline
      R Offline
      Ryan Johnston 0
      wrote on last edited by
      #2

      I'm just guessing from your "IF THEN" stuff that you are using VBscript and ASP? Well I actually know nothing of either, but I have done plenty of this stuff in other languages. I would break the string up into parts (do you have any kind of function that will allow you to just get part of a string?), and loop through testing each part. Ryan Johnston

      1 Reply Last reply
      0
      • R Robby

        I have a drop down list - code is: APPMANAGER002 APPMANAGER004 APPMANAGER040 APPMANAGER078 APPMANAGER124 This list allows multiple selections. We all know that if I were to select both APPMANAGER002 & APPMANAGER078 from the list, that the results are passed as 002,078,etc. What needs to happen is this: If I select APPMANAGER002 from the list, I need to send an email to this person with a notification. I need to duplicate this for each selection from the list. How can I look at the results and perform this? For instance, if this did NOT allow multiple selections, I could simply do a "IF APPMANAGER=002 THEN...". Since my results may be a string of selections, the IF statement above wouldn't work because the results may be APPMANAGER=002,078. Since I have NO idea what combination of results I will get, how can I look at the results, and based on what's in the string, perform IF THEN statements? Does this make sense? Thanks for any help! Robby

        J Offline
        J Offline
        Jared Solomon
        wrote on last edited by
        #3

        You can use this Vbscript/ASP code to parse the value of the dropdown and get each value between the commas seperatly string1="test,test2" ' this is the string from the dropdown in it's original state divider="," 'this is the divider. string1=string1 & "," 'add the divider at the end to make sure you pick up the last value 'in case the divider character is not already at the end. For counter1 = 1 To len(string1) if Mid(string1,counter1,1) <> divider Then counter2 = counter2 + 1 Else tempstring = Mid(string1,counter1-counter2,counter2) if tempstring <> "" then 'this is where you email code goes 'tempstring is the value from between the comma MsgBox(tempstring) end if counter2 = 0 End if Next Jared Solomon Programmer/Analyst

        1 Reply Last reply
        0
        • R Robby

          I have a drop down list - code is: APPMANAGER002 APPMANAGER004 APPMANAGER040 APPMANAGER078 APPMANAGER124 This list allows multiple selections. We all know that if I were to select both APPMANAGER002 & APPMANAGER078 from the list, that the results are passed as 002,078,etc. What needs to happen is this: If I select APPMANAGER002 from the list, I need to send an email to this person with a notification. I need to duplicate this for each selection from the list. How can I look at the results and perform this? For instance, if this did NOT allow multiple selections, I could simply do a "IF APPMANAGER=002 THEN...". Since my results may be a string of selections, the IF statement above wouldn't work because the results may be APPMANAGER=002,078. Since I have NO idea what combination of results I will get, how can I look at the results, and based on what's in the string, perform IF THEN statements? Does this make sense? Thanks for any help! Robby

          L Offline
          L Offline
          lizhill
          wrote on last edited by
          #4

          you can do this is VBScript/ASP like this: Hope it help!:) dim strSelect, arrSelect strSelect = Request.Form("APPMANAGER") ' check to see if user select multiple if Cint(inStr(strSelect, ",")) > 0 then ' user selects more than one entry, put in an array collection arrSelect = split(strSelect, ",") for i = 0 to UBound(arrSelect) ' you put send mail here or call a function to send mail doMail(arrSelect(i)) Response.Write arrSelect(i) next ' now you can do whatever with it. else ' strSelect has only one entry you can do it here. ' you can send mail here or call a function to send mail. doMail(strSelect) Response.Write "you select : " & strSelect end if sub doMail(managerID) ' do mail here end sub __________________________________________ lizhill

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups