Drop Down w/Multiple Selections
-
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
-
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
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
-
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
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 -
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
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