Developer forum

Forum » Development » Form: Dropdown-box

Form: Dropdown-box


Reply

Is there a way you can use a value from a dropdown-box directly in the formular?


 


The reason I ask, is that I am trying to create a dropdown-box, with three different contacts, and thereby three different email-adresses. When one creates a formular, you have to type in a reciepient. I would like that to be the value of the dropdown-box, so if the user choses contact 1, an email gets sent to contact 1 and if contact 2 is selected an email is sent to contact 2.


 


Is this possible?


 


You have to give the dropdown-box a system-name, so one must be able to access the value by using this name. I would imagine that you would have to type in something like


 


!--@FormToEmailValue[systemname]--


 


Or something simular...


 


 


- Lars Britz


Replies

 
Nicolai Høeg Pedersen
Reply

You can use a javascript in your master or page template:


 



 


 SendFormTo is a dropdown box with e-mail adresses as values. Recipient is the name of the field containing the recipient of the form.


 

 
Nicolai Høeg Pedersen
Reply

 
Reply

You have to specify a recipient in the form-module but I want to avoid this, so I guess I have to create a formmail instead, by using the dokumentation.txt?

 
Nicolai Høeg Pedersen
Reply
larsbb wrote:


You have to specify a recipient in the form-module but I want to avoid this, so I guess I have to create a formmail instead, by using the dokumentation.txt?





 


You can just specify a bogus e-mail address and set the one you want when the user chooses another. But you can also use Formmailer.

 
Reply

Of course... Why didnt I think of that myself.

 


 


It doesnt quite work however. Do I have to add something to the script you gave me? Like a systemname of the dropdown-field?

 
Reply

The recipient field shoud be named FM_ToEmail.

 
Reply

I must be slightly retarded, because it still doesnt work for me. These are my settings:


 


1.


Modules >> Form >> Kontakt_2 >> FM_ToEmail >> Field: Vælg Afdeling >> Systemname: FM_ToEmail


 


2.


Page in navigation: FormModule >> Recipient: dgjkdgj@dgkkdg.dk


 


3.


Mastertemplate:


 


In the header i have added:


 




 


 


 


What am I doing wrong?

 
Nicolai Høeg Pedersen
Reply

Hi Lars


 


Cannot help anymore - it would just be a wild guess. But it seems like you get the idea, and then you just have to figure it out.


 


If you cannot you would have to provide a URL for us to check out.

 
Reply

The Url is: http://lbr.net.dynamicweb.dk/Default.aspx?ID=20


 


I appreciate your help so far!

 
Nicolai Høeg Pedersen
Reply
larsbb wrote:


The Url is: http://lbr.net.dynamicweb.dk/Default.aspx?ID=20




 




I appreciate your help so far!





 


OK - this script will work with your form:



 


And place the script after the form - not before in the header as you did. Else the script will fail.

 
Reply

Thanks! It doesnt quite work, but I will just have to spend a little time trying to figure it out. At least the basic idea is in place and I know now that the script has to be placed in the master-template, before the and after the content.

 


 


Thank you for your help!

 
Nicolai Høeg Pedersen
Reply
larsbb wrote:


Thanks! It doesnt quite work, but I will just have to spend a little time trying to figure it out. At least the basic idea is in place and I know now that the script has to be placed in the master-template, before the and after the content.



 




 




Thank you for your help!





 


I inserted the script - now it works.

 
Reply

Thanks a lot!

 

You must be logged in to post in the forum