5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1352 Views |
-
dropdown list in contect us form

15 June 2009 at 11:38pm
how to show in dropdown list in contect us form..........
-
Re: dropdown list in contect us form

16 June 2009 at 5:28pm
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
-
Re: dropdown list in contect us form

17 June 2009 at 2:13am
thanks sir please give me answer this question :http://www.silverstripe.org/widgets-2/show/262562?showPost=262562
-
Re: dropdown list in contect us form

20 June 2009 at 2:21am Last edited: 20 June 2009 2:22am
multiple record insert by admin and by menu want to display on site this multiple record so, please help me...., how to possible.........
-
Re: dropdown list in contect us form

13 May 2013 at 9:10pm Last edited: 13 May 2013 9:15pm
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.
-
Re: dropdown list in contect us form

15 May 2013 at 8:04pm
Have you setup your $has_one = array('Location' =>'LocationPage');
-
Re: dropdown list in contect us form

15 May 2013 at 9:13pm
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!!!!
| 1352 Views | ||
|
Page:
1
|
Go to Top |



