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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

userforms rules not working


Reply


4 Posts   1642 Views

Avatar
theoldlr

Community Member, 103 Posts

17 December 2009 at 9:07pm

Edited: 17/12/2009 9:13pm

I am trying to make a dynamic form, but I'm either misunderstanding the rules or something is not working.

For example let's say I have a drop down field "Is silverstripe your cms" with the choices 'choose', 'Yes', and 'No'. If the user selects 'No' I would want a text field to appear that says "why not?"

The properties I would assign to the 'why not?' textfield would be 'hide by default' and 'Show this field' When 'Is silverstripe your cms' 'Value' 'No'

Is this how it is supposed to work? It is not working for me. Do you need to put in quotes or any escape characters for special characters in the last rule field?

Thanks!

Edit: Just noticed this JavaScript Error in firebug... Is this the problem, Advice on a fix?:

$("#Form_Form").validate is not a function
anonymous()quotes?flush=1 (line 203)
anonymous()jquery.min.js (line 19)
anonymous([function(), function(), function()], function(), Object name=F)jquery.min.js (line 12)
anonymous()jquery.min.js (line 19)
anonymous()jquery.min.js (line 19)
[Break on this error] required:1 \nquotes?flush=1 (line 203)

Avatar
Willr

Forum Moderator, 5513 Posts

17 December 2009 at 9:23pm

$("#Form_Form").validate is not a function

That would normally mean jquery.validate.js has not loaded. What versions SS/UDF are you trying to use.

Avatar
banal

Community Member, 901 Posts

17 December 2009 at 10:48pm

Maybe this helps:
http://silverstripe.org/general-questions/show/269138?showPost=275634

Avatar
theoldlr

Community Member, 103 Posts

18 December 2009 at 5:56pm

It was a conflict with jquery as I had already implemented [url=http://www.ssbits.com/clearing-the-search-field-on-click-with-jquery/]this.[/url] Once I replaced the reference to jquery via google with the one used by userforms everything was working as it should. Thanks for your help.