Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions /

dropDownField in Userforms does not work (OptionsetFieldSet OK)


Reply


7 Posts   1702 Views

Avatar
lise

Community Member, 47 Posts

23 December 2009 at 8:41am

I am trying to use a DropdownField in a userform but it does not seem to work (Silverstripe 2.3.3).
What I did was :

1) reuse the code used in the tutorial-3 on forms:
new OptionsetField('Browser', 'Your Favourite Browser', array(
'Firefox' => 'Firefox',
'Internet Explorer' => 'Internet Explorer',
'Safari' => 'Safari',
'Opera' => 'Opera',
'Lynx' => 'Lynx'
))

thsi works fine. I can enter the form , send it and receive the notification.

2) but if I *just* change "OptionsetField" with "DropdownField" :

new DropdownField('Browser', 'Your Favourite Browser', array(
'Firefox' => 'Firefox',
'Internet Explorer' => 'Internet Explorer',
'Safari' => 'Safari',
'Opera' => 'Opera',
'Lynx' => 'Lynx'
))

I can see the form , choose an option from the DropDownMenu but when I click on "Send" nothing happens and there is no
message in the error log.

Any ideas??
Thanks

Avatar
Willr

Forum Moderator, 5513 Posts

23 December 2009 at 9:22am

You are probably running into this issue - http://open.silverstripe.org/ticket/4586 which was fixed recently. Download the latest release and try that out.

If you are running 2.3 - http://open.silverstripe.com/changeset/latest/modules/userforms/branches/0.2?old_path=/&filename=/userforms/&format=zip

If you are running 2.4 - http://open.silverstripe.com/changeset/latest/modules/userforms/trunk?old_path=/&filename=/userforms/&format=zip

Avatar
lise

Community Member, 47 Posts

23 December 2009 at 9:30am

Edited: 23/12/2009 9:41am

Thanks Willr for the very prompt reply. I do appreciate.
I will install the patch right away

Cheers!

Edit: Patch installed on 2.3.3 It works great! Thanks a lot

Avatar
Willr

Forum Moderator, 5513 Posts

23 December 2009 at 9:35am

Sorry just rereading your thread - you said userforms but I don't think you're using userforms at all? With userforms you don't need to write any PHP code. If you are having issues with a form you wrote in PHP then its unlikely userforms has anything to do with it.

Post your custom code and we might be able to help out with that.

Avatar
lise

Community Member, 47 Posts

28 December 2009 at 4:56pm

Hi Willr,

Actually I am re-using the code documented by Aram from ssBits in his tutorial (http://www.ssbits.com/creating-a-simple-contact-form/). . The reason is that my customer wants an email notification and a pop-up window and I was not able to do it using
"Userforms" out of the box. The php code creates a new Fieldset and "FormAction" ...Isn't this part of the userform module?

The strange thing is that the patch you gave me (above in this thread) resolve the problem of the dropDownField and besides
this, the code only works if the userform module is installed .
Thanks - Lise

Avatar
Webdoc

Community Member, 334 Posts

30 December 2009 at 10:33am

How to add on dropdown selection onchange="FilterModels()
like this:
<select name="makes" onchange="FilterModels()" id="makes">

Avatar
Willr

Forum Moderator, 5513 Posts

1 January 2010 at 9:17pm

Webdoc - off topic to this post so you when you want to break discussion off a topic please make a new thread.