<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Form Help</title>
			<link>http://www.silverstripe.org/archive/show/160531?start=0#post165729</link>
			<description>&lt;p&gt;The first part of my problem is due to using a custom template with the forTemplate() function. If I use a regular template, things are fine obviously. This part isn't to big of a deal and I can handle it later.&lt;/p&gt;&lt;p&gt;However, I'd really like to be able to solve the 2nd part. That is having a contact form with a drop down field so users can choose where the email gets sent to. Has anybody ever done this before that has code working?&lt;/p&gt;&lt;p&gt;My attempt above didn't work.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Form Help &lt;a href=&quot;http://www.silverstripe.org/archive/show/160531?start=0#post165729&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/160531?start=0#post165729&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 09 Sep 2008 12:11:14 +1200</pubDate>
			<dc:creator>LeeUmm</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/160531?start=0#post165729</guid>
		</item>
		
		<item>
			<title>Form Help</title>
			<link>http://www.silverstripe.org/archive/show/160531#post160531</link>
			<description>&lt;p&gt;Been a long day, and I'm sure I'm missing the obvious here but I need some help.&lt;/p&gt;&lt;p&gt;Contact form fields:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;$fields = new FieldSet(&lt;br /&gt;new TextField('Name', 'Your Name:'),&lt;br /&gt;new EmailField('Email', 'Your Email:'),&lt;br /&gt;new DropdownField('To', 'To:', $source = array(&lt;br /&gt;'Not Sure',&lt;br /&gt;'Name 1',&lt;br /&gt;'Name 2'&lt;br /&gt;)&lt;br /&gt;),&lt;br /&gt;new TextareaField('Message', 'Message:', '5', '35')&lt;br /&gt;)&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;In my template, I can produce the fields, but no names/labels for them. The following label shows up blank, but the input is shown. The fields are required, and if you click in the input box and click away without typing anything, I get the error message &quot;Please fill out 'this', it is required.&quot; instead of the proper field name, it uses &quot;this&quot;. Demo here - &lt;a href=&quot;http://www.mcgowangroupinc.com/new/contact/&quot;&gt;http://www.mcgowangroupinc.com/new/contact/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;label for=&quot;$FormName_Email&quot;&amp;gt;$FormName_Email&amp;lt;/label&amp;gt;&lt;br /&gt;$dataFieldByName(Email)&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Also, the dropdown field gives the user an option to pick who the email should be sent to. I have this in my doForm() function which sends the email:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($fields-&amp;gt;to == 0){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$email-&amp;gt;to = 'email 1';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} elseif ($fields-&amp;gt;to == 1) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$email-&amp;gt;to = 'email 2';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} elseif ($fields-&amp;gt;to == 2) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$email-&amp;gt;to = 'email 3';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;No matter which option is picked, it always sends to email 1. I've written the same thing using a switch statement with no luck either. In my email template, the variable $To produces the correct number associated in the drop down.&lt;/p&gt;&lt;p&gt;I'm sure I'm missing something obvious as its been a 12+ hour day.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Form Help &lt;a href=&quot;http://www.silverstripe.org/archive/show/160531#post160531&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/160531#post160531&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 04 Sep 2008 16:36:03 +1200</pubDate>
			<dc:creator>LeeUmm</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/160531#post160531</guid>
		</item>
		

	</channel>
</rss>