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.

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.

All other Modules /

Discuss all other Modules here.

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

userforms rules not working


Go to End


4 Posts   2094 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, 5523 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
bummzack

Community Member, 904 Posts

17 December 2009 at 10:48pm

Avatar
theoldlr

Community Member, 103 Posts

18 December 2009 at 5:56pm

It was a conflict with jquery as I had already implemented this. 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.