I tried clicking on the green plus sign to add custom rule. I'm not sure what an add rule does, but nothing opens up after clicking on this link in the userforms module.
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.
- Page 11(current)
- 2
- Next 10 entries
There needs to be a change on UserForm.js line 255:
from
$(".customRules .addCondition").click(function() {
needs to match this. And then you can get Custom Fields to work.
$(".addCondition").live('click', function() {
Can anyone help me figure out how to add custom css rules to certain text fields. I would like first/last name to float next to each other on the same row (Custom CSS Userforms Help please)
Thanks for this tip. Is there any reason why this isn't enabled by default?
This was a bug that was fixed last week - http://open.silverstripe.org/changeset/106720
Download the trunk / daily build version from http://silverstripe.org/user-forms-module/ to get this fix. I'll give the 0.3.0 release another week for any more bugs and do some more testing and do a 0.3.1 release to cover this issue and a couple other ones.
Quote
Can anyone help me figure out how to add custom css rules to certain text fields. I would like first/last name to float next to each other on the same row (Custom CSS Userforms Help please)
The easiest way I have found is to style using the "id" of the field (or its container more specifically) which will be unique to that form based on the field type. Then use
div#EditableTextField1, div#EditableTextField2{float:left; clear:none}
in your form.css for example.
Only down-side is that the first two text fields of any other UDF will also float left.
@Willr
Do you think it would be appropriate to have an option to add an additional css class to a form field in the options dialogue?
It's perhaps not an ideal end user setting but I do think there is a need to control the layout of individual form fields sometimes, I've done it on several occasions and with a long form, styling with the id can get very tedious and runs into issues when you have more than one form on the site.
I have experimented with EditableTextField and got it working nicely using $field->addExtraClass(), no validation yet but I'm not going to bother unless you're open to it as useful functionality.
Cheers,
Rich
@TotalNet - Funny you mention adding classes. I had just created a ticket for it http://open.silverstripe.org/ticket/5751 from http://silverstripe.org/customising-the-cms/show/287199?start=0#post287207. But yes I think it would be useful and relatively easy to integrate.
Well in that case...
I've checked out the latest trunk code for UDF and will look into it this week. Do you have any timescales for 0.3.1 or can I take my time with this? ;)
Cheers
Rich
- Page 11(current)
- 2
- Next 10 entries