We are using WFFM for our landing pages creation. It is very easy for our marketing guys to use that. Now, we are looking at customizing them. For instance, we have the following requirement.
On our form, we display country of residence, but when you select some countries, we want to display one more dropdown called state/province
with the states. When user selects other countries, we have to hide the state/provice
field. I am banging my head, how can I start implementing this.
Can anyone of you guide me, how to proceed?
Try the following:
- Create a
DropList
field on your form in Sitecore - Add an Option named something like "NA" (signifying "Not Applicable")
- Mark the field as required
- Click on the "Edit" button, under "Rules" in the left pane
- In the left box, scroll down to the "Fields" category and enter the relevant information into the "where specific field compares to specific value
- In the right box, select "hide element", under the "Actions" category
I had problems getting this working on Sitecore 7.5 (rev. 141003).
I have not tried the following instructions out yet, but here is what I eventually was able to get from Sitecore support:
It looks like the reported behavior is caused by the previously registered bug with the 67793 reference number. More information about public reference numbers can be found here: https://kb.sitecore.net/articles/853187
Please try applying the following patch to see if it helps:
Put the attached "Sitecore.Support.401148.dll" assembly into the "\bin" folder.
Change the type field values for item information rules(rule content path -> Type field value):
/sitecore/system/Settings/Rules/Definitions/Elements/Item Information/Item ID -> Sitecore.Support.Rules.Conditions.ItemConditions.ItemIdCondition,Sitecore.Support.401148
/sitecore/system/Settings/Rules/Definitions/Elements/Item Information/Item Name -> Sitecore.Support.Rules.Conditions.ItemConditions.ItemNameCondition,Sitecore.Support.401148
/sitecore/system/Settings/Rules/Definitions/Elements/Item Information/Item Template -> Sitecore.Support.Rules.Conditions.ItemConditions.WhenTemplateIs,Sitecore.Support.401148
- Change the type field values for "Fields" rules(the rule content path -> the "Type" field value): /sitecore/system/Settings/Rules/Definitions/Elements/Fields/Field -> Sitecore.Support.Rules.Conditions.FieldConditions.WhenField,Sitecore.Support.401148
/sitecore/system/Settings/Rules/Definitions/Elements/Fields/Field is Empty -> Sitecore.Support.Rules.Conditions.FieldConditions.FieldEmpty,Sitecore.Support.401148
/sitecore/system/Settings/Rules/Definitions/Elements/Fields/Has Specific Field Type -> Sitecore.Support.Rules.Conditions.FieldConditions.WhenHasSpecificFieldType,Sitecore.Support.401148
来源:https://stackoverflow.com/questions/7919088/webforms-for-marketers-form-fields-conditional-visibility-dynamically