Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Contact form dropdown list email View modes: 
User avatar
Member
Member
Leandro Brito - 11/1/2013 6:44:21 AM
   
Contact form dropdown list email
Hello,

I need to create a contact form with a dropdown list with "To" values, for example:


<dropdownlist><value, text>
marketing@example.com, Marketing
hr@example.com, Human Resources
comercial@example.com, Comercial

When the user choose some option I need to show a description in the side of the dropdown , like this

option selected
marketing@example.com, Marketing

summary in the right side of the dropdown list
Marketing
Phone Number: 123 456 789
marketing@example.com
Paul Simmon

There is a way to do that?
Portal engine solutions would be better.

Thanks
Leandro

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 11/3/2013 9:27:30 PM
   
RE:Contact form dropdown list email
In your form the field you want to be a dropdownlist, make sure you select dropdown field and in the options box enter your values separated by a semi-colon. One value/name pair per line
marketing@example.com;Marketing
hr@example.com;Human Resources
comercial@example.com;Comercial

User avatar
Member
Member
Leandro Brito - 11/4/2013 4:36:41 AM
   
RE:Contact form dropdown list email
Right, but the issue is the description of the option (phone number, person name etc).
Can I add a new attribute in my option with these descriptions and show it using jQuery?

e.g.
<option Value="marketing@example.com" Text="Marketing" Description="Marketing<br />Phone Number: 123 456 789<br /> marketing@example.com<br /> Paul Simmon"/>

Is there another way to store this information and get by javascript/jquery?

Thanks
Leandro

User avatar
Member
Member
Leandro Brito - 11/4/2013 4:46:35 AM
   
RE:Contact form dropdown list email
Leandro Brito wrote: Right, but the issue is the description of the option (phone number, person name etc).
Can I add a new attribute in my option with these descriptions and show it using jQuery?

e.g.
<option Value="marketing@example.com" Text="Marketing" Description="Marketing<br />Phone Number: 123 456 789<br /> marketing@example.com<br /> Paul Simmon"/>

Is there another way to store this information and get by javascript/jquery?

Thanks
Leandro


I suggested jQuery because I need to avoid C# code using Portal Engine, it's a customer request

User avatar
Member
Member
eagleag - 11/4/2013 1:44:04 PM
   
RE:Contact form dropdown list email
Hi,

I think the simplest way to achive this, might not be the cleanest, is to do the follwing:

1) create a Custom tAbel to hold all the detials:
Marketing
Phone Number: 123 456 789
marketing@example.com
Paul Simmon

2) create a Drop down List field in form and use SQL QUERY to get: marketing@example.com Marketing from custom table.

3) on the same page place a Custom Tabel Repeater that repeats all item you added to custom table.
make sure that each item that is echoed to html is wrapped with a <div> and give it an id of the email or the name ( example: <div class="marketing@dom.com"> or <div clas="marketing>).

make sure each of these divshas class disaply:none 9that way by defautl all items will NOT show.

4) write js code the triggers on selected changed in drop down and take new selected value and search for it where custom repeater code is.
find a match and make it visible.


good luck

User avatar
Member
Member
Leandro Brito - 11/6/2013 7:25:23 AM
   
RE:Contact form dropdown list email
Hi,

Repeater is a good idea!

I'll check it and let you guys know if it works fine.

Thank you, I appreciate your help.

Leandro

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 11/4/2013 12:52:22 PM
   
RE:Contact form dropdown list email
It sounds like you might want to use a repeater and generate an unordered list vs. using the dropdown functionality which is limited. You can attempt to style the ddl text by using a select statement and concatenating the values to get your text although I'd suggest a repeater over that. This shouldn't require any server side code either. You would need to style the list as needed though.

User avatar
Member
Member
Leandro Brito - 11/6/2013 7:26:11 AM
   
RE:Contact form dropdown list email
Hi,

I'll work on that and post here my results.

Thank You

User avatar
Member
Member
Leandro Brito - 11/12/2013 11:31:24 AM
   
RE:Contact form dropdown list email
Hello,

It's worked fine.

I first try using a static html to put my divs and after that I change for custom table/repeater.

Thanks for the help.
Leandro