Conditional fields using web forms for marketers? - sitecore

I need to show/hide a field based on the value entered in another field. The field that is conditionally made visible also needs to be a mandatory field.
Is this possible using WFFM? Will I need to do it using custom fields?
Thanks!

You would need to build a custom complex type to do this. You might be able to re-use existing field types in your custom type, but it would probably be simpler to create them specifically for the new complex type.

You can use JQuery for this and also you can create custom field for this you just simply copy and paste previous one and reflect Sitecore.Forms.Core.dll and see the code how you can achieve this. But I generally use JQuery if I can manage via this

Related

Show field based on another fields value using rules, WFFM, Sitecore8.1

I want to conditionally show a field in a web forms for marketers form in Sitecore 8.1.
My thoughts was that rules could be utilized to that. the only problem is that it seemingly does not work.
When I set a field to conditionally hide based on the value of another field, nothing happens when I satisfy the condition ie. enter the conditional value.
My intuition here is that the rule editor is not working on realtime on the form (by using JavaScript) but is only something that runs on the server.
Can anybody confirm this? Or otherwise send me the right direction towards realtime updating the form based on rules?
Greetings Mads Buch
You will require to use Javascript. What you can do is to create a custom rule which will be triggered via javascript. You can check the following link on how to create a custom rule https://jeffdarchuk.wordpress.com/2015/06/04/lets-use-that-rules-engine/
Also, you may create a custom type as suggested in this thread.
Thanks

Django add attribute to individual radio or checkbox

I'm using a ModelForm to create multiple choice questions, and I want to apply a CSS class to a particular option (the "other" choice, in my case).
Is there a simple way to do this? It seems like it could theoretically be done with a custom widget, but I haven't been able to make a functional custom widget.

Determining which attributes were modified in an ember-data model

Is there any way of telling exactly which attributes were changed on a dirty record using ember-data?
The docs show a changedAttributes method, but I can’t use that directly because I want to bind it in a template.
I could set up observers for every field to get an event when they are updated, but that seems like a tedious solution, I was wondering if there was an easier way.
Edit: My use case is basically that I'm trying to indicate which fields were modified in an "edit" form.
There is an object _attributes on the record that has all the modified properties/values, you could use Em.keys on it for them all.

Implement a typeahead for manytomany field

I am looking for a robust solution to implement a typeahead (Twitter typeahead) for a manytomany field. Basically, something identical to the tag input field here in StackOverflow.
The default widget for manytomany is a multiselect. However, since I want the user to provide new values, I need to use a inputText widget. My question is, what would be the best way to implement this functionality so that I can later pass an array of models instances to a cleaning stage?
In my cleaning stage I plan on doing a loop through the elements to check if they exist in the db, create them if they don't and apply validators to each elements.
My initial intuition was to use a hidden field that would receive the actual fields from the typeahead via javascript manipulation. Thus the input field would not be part of the model, just serve as an input box for the user.
Why reinvent the wheel. You can simply use django-taggit together with selectize.js. By using both of them, you don't even need any customization.

EMF: Restricting choices to predefined values

I am using EMF to allow users to create instances of a particular type of model.
An instance of a model can have 0-* Things but I'd like to be able to predefine the available Things that the user can add to the instance so that they can't just create their own.
How would I go about creating the Things using the ecore model?
If a Thing was just a String then it would be fine - I could use Enums. But a Thing is a type of it's own and consists of other stuff (like a name, version etc.) and I don't know how to give a predefined set of these to the user to choose.
Any ideas?
You have the possibility to use constraints or *EOperation*s.
For a better usability you should use a own dialog implementation. An example of a own implementation with given choices you can find here:
How can I control which instances are available as choices when editing a property in the properties view?
You should also implement a own property source to support the properties editor:
Recipe: Create your own property editor in a generated application