• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How to display selected drop-down value in email

How to display selected drop-down value in email 13 years 2 months ago #13001

  • dominic.conrad
  • dominic.conrad's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
I have a dropdown list as one of the components in my form. The text in the 'items' filed is as follows:
|Please select enquiry subject[c]
dave@yahoo.com|Registration
tony@yahoo.com|Marketing
mark@yahoo.com|Sales

If the Name of thi field is Subject, then {Subject:value} will print the email address.

How do I get it to print the 'enquiry subject' i.e. Marketing, Registration or Sales, in the email itself?

Many thanks
Last Edit: 13 years 2 months ago by dominic.conrad. Reason: typo
The administrator has disabled public write access.

Re:How to display selected drop-down value in email 13 years 2 months ago #13002

Hi Dominic:

I can think of a couple ways of doing this. The perfect way would be to store all the information in the database. However, as I haven't even begun to play with the database, I wouldn't even know where to start. I'll let wiser heads than mine address that issue.

The second way is to use hard coded script values (which is not a very good solution, but may be the easiest to do). Write an "on-change" Javascript so that when a user changes the value of the dropdown, the Javascript then sets two hidden fields with appropriate values. For example, if the user selects "registration," the script would put " This e-mail address is being protected from spambots. You need JavaScript enabled to view it " into the EmailAddress hidden field and "Registration" in the DepartmentName hiddenfield. You can then use {EmailAddress:value} and {DepartmentName:value} in the e-mail.

A slightly better way that avoids hard coding into a Javascript (with all the problems that can bring) is to code the department & e-mail address into the value of the dropdown. For example, instead of "tony@yahoo.com|Marketing," use something like "Marketing/tony@yahoo.come|Marketing." You can then write an on-change Javascript that looks for the "/" (or whatever character best suits your purpose) and then divides the value into the EmailAddress and DepartmentName fields as above.

Best of luck.

Ta ra 'wan,

CM
The administrator has disabled public write access.

Re:How to display selected drop-down value in email 13 years 2 months ago #13006

  • dominic.conrad
  • dominic.conrad's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
That's very kind of you to explain CM.

I can follow your thinking and see the potential for all solutions. Trouble is I'm cak on Javscript! I'm trying to have the form data sent to different recipient mailboxes depending on users selection from drop down and the admin email content/subject line to be worded according to the selected option. I'm sure you can see that.

I like the sound of the final option. Any chance you might be able to assist with the JS? I could owe you some CSS time if you're up for it??
The administrator has disabled public write access.
The following user(s) said Thank You: love2unlimited
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!