Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Email change from dropdown list

Avatar

Level 3

I have looked at the other threads on this subject and discovered I am a complete moron when it comes to doing this.

can anyone give me a step by step guide on what I need to do to my dropdown list.  if any of the first 5 options are choosen, then the email address will be set to A and any of the last 5 options choosen, email will be B.

I'm sure I am making this harder than it needs to be

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I created a sample for you ....the code is on the exit event of the DDlist. When you have it working the

button needs to be hidden so the user cannot see it. The script will click the button when ready.

paul

View solution in original post

7 Replies

Avatar

Former Community Member

The DDList has a selectedIndex property. This tells you which index was selected (not it is a 0 based index).

So you could write script on the exit event that would do something like this:

if (this.selectedIndex < 4){

     send email to userA

} else {

     send email to userB

}

paul

Avatar

Level 3

Sorry, your just confirming my moron staus.

I have only used basic fuctions of LC and action builder for everything else, I am not familiar with the steps you said.

Avatar

Correct answer by
Former Community Member

I created a sample for you ....the code is on the exit event of the DDlist. When you have it working the

button needs to be hidden so the user cannot see it. The script will click the button when ready.

paul

Avatar

Level 3

Wow, I understand now!!!!

Thanks for clearing that up for me. I am going to promote myself to just a mere LC idiot now

Avatar

Level 3

Hi Paul,

if I wanted to add a CC to it, what would that like in the script?

Thanks In advance

Avatar

Former Community Member

The mailto protocol is a public domain spec. If you do a google search you can see all of the options for controlling the email. To answer your question:

mailto:test@test,com?cc=test2@test2.com

Paul

Avatar

Level 3

Paul,

thanks for the answer and the google search advise to advance my edification

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----