Forum

Thread tagged as: Question, Forms

Multiple receivers in Forms

I have created a form with select option for several department at a car dealership. This is a campaign site for multiple dealerships so the customer can choose which dealership they want an offer from via the select list in forms. Then I use the dealership ID to use as a sender in Forms App. The request from the car dealership is to use several emails for one dealership. I am aware that it could be easily done in the Forms App option, but need to set the email addresses in the select option. When I try to put multiple emails in the select option it does not register any on submit.

This is my select option in form template. Repeater #1 works just fine, repeater #2 doesnt submit any address or information. alt text for image

This is my Forms App options. alt text for image

This is my code for the select option, repeater for each dealership.

<perch:label for="forhandler">Velg forhandler</perch:label> 
        <perch:input type="select" id="forhandler" label="Forhandler" required="true" options=" 
<perch:repeater id="forhandler" label="Forhandler"> 
<perch:content id="skjemaForhandlerNavn" type="text" label="Forhandlernavn" />|<perch:content id="skjemaEmail" type="text" label="E-post" />
<perch:if id="perch_item_index" match="neq" value="{perch_item_count}">,</perch:if> 
</perch:repeater> " />

Is there a way to put several emails in the id="forhandler" seperated by commas? Or do I need to create a Bcc field of some kind? The id="forhandler" ID should be used as a sender for auto-response as well so should probably just have one email address on that ID?

Erick Green

Erick Green 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say repeater #2, do you mean a second instance of a repeater field, or the second item in the same repeater?

Sorry. I mean the second item in the repeater. With the content "Car dealership 2" and "car@dealership.com, trucks@dealership.com".

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't think of any way you could access the result of the repeater using this method. It doesn't really address content in repeaters or blocks.

So the ´<perch:if id="perch_item_index" match="neq" value="{perch_item_count}">,</perch:if>´ puts a comma between each option in the form options field. Is there a way to get commas in ´id="skjemaEmail"´ field as well? See the full code below.

<perch:input type="select" id="forhandler" label="Forhandler" required="true" options=" 
        <perch:repeater id="forhandler" label="Forhandler"> 
        <perch:content id="skjemaForhandlerNavn" type="text" label="Forhandlernavn" />|<perch:content id="skjemaEmail" type="text" label="E-post" /><perch:if id="perch_item_index" match="neq" value="{perch_item_count}">,</perch:if> 
        </perch:repeater> " /> 

When i try put several email addresses separated by comma in the ´id="skjemaEmail"´ field, it registrer the email address after the comma as a new option.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The commas in a select field options attribute can be escaped with a backslash:

options="Fred\, Wilma and Pebbles|flintstones,Barney\, Betty and Bambam|rubbles"