how to show in dropdown list in contect us form..........
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Is you contact form a UserDefinedForm or a Standard PHP form?
The dropdownfield docs is available at http://doc.silverstripe.com/doku.php?id=dropdownfield
thanks sir please give me answer this question :http://www.silverstripe.org/widgets-2/show/262562?showPost=262562
multiple record insert by admin and by menu want to display on site this multiple record so, please help me...., how to possible.........
Hi all! I got to make a dropdown in my contact form in SS 2.4
Since I am emailing the info from the form, In the email template im getting the ID of the dropdown object instead of its value.
This is the code..
in function ContactForm
$locations = DataObject::get('LocationPage');
if ($locations) {
$locations = $locations->toDropdownMap('ID', 'Title', '(Select one)', true);
}
$fields = new FieldSet(
new DropdownField('LocationID', 'Location', $locations) ------> According to the tutorial I need to use Location ID, but then how do I get the Title to show in the template???
);
Then in the template I use $LocationID and it returns the ID of the location. If I use $Location or similar names nothing will show up or the email will not be sent.
How can I display the selected location Title in the template?
Thank you.
Have you setup your $has_one = array('Location' =>'LocationPage');
I got it!!!
Just had to make this change:
$locations = $locations->toDropdownMap('ID', 'Title', '(Select one)', true);
INTO
$locations = $locations->toDropdownMap('Title', 'Title', '(Select one)', true);
thank you!!!!