Creating form with code first and conditional logic
Hi
I am creating a form using code first and conditional logic. However, I am having an error message on displaying the form 'Sequence contains no matching element' when adding the conditional rule. Please refer to the code below. Can you please advise where am I going wrong? Thanks
Any suggestions how you managed to get it working ?
Am working with a custom field Label but cant get the conditional logic to work.
public class DCLabel : FieldType
{
[Umbraco.Forms.Core.Attributes.Setting("Text to Display ", prevalues = "", description = "Enter the text to show in the label", control = "Umbraco.Forms.Core.FieldSetting.TextArea")]
public string LabelToShow { get; set; } }
For the conditional logic to work, you need to add a dummy condition like for example,
[FieldConditionRule("Field name", FieldConditionRuleOperator.Is, " ")]
For the 'Code Sequence' error, you need to check that you are not using the same field names anywhere.
Creating form with code first and conditional logic
Hi
I am creating a form using code first and conditional logic. However, I am having an error message on displaying the form 'Sequence contains no matching element' when adding the conditional rule. Please refer to the code below. Can you please advise where am I going wrong? Thanks
Hey Aaeda,
Have you been able to get the conditional logic working on this ?
//fuji
Hi Fuji
Yes I got it working! it's been a while already :)
Aaeda
Any suggestions how you managed to get it working ?
Am working with a custom field Label but cant get the conditional logic to work.
Hi Fuji
I don't see the conditional logic you are trying to do. In the code you sent, you are only creating the field.
A.
Sorry here is the code
[Field("test", "test", EnableCondition = true, ConditionActionType = FieldConditionActionType.Show, ConditionLogicType = FieldConditionLogicType.Any)]
[FieldConditionRule("LabelToShow", FieldConditionRuleOperator.Is, "True")]
public string Hidden { get; set; }
Aaeda ... I am having the same problem (my post about it is: http://our.umbraco.org/forum/umbraco-pro/contour/60438-Codefirst-form-error-Sequence-contains-no-matching-element,-multiple-fields-in-db). Would you mind sharing the solution since you got your form working?
Thank you! chester
Hello Chester
For the conditional logic to work, you need to add a dummy condition like for example, [FieldConditionRule("Field name", FieldConditionRuleOperator.Is, " ")]
For the 'Code Sequence' error, you need to check that you are not using the same field names anywhere.
Hope this helps.
Regards Aaeda
is working on a reply...