We are running umbraco v 4.11.4 (Assembly version: 1.0.4780.19111), with Contour 3.0.7
We have experienced a number of issues with enabling conditions on our forms (which admittedly are rather complex). Most notably, checkboxes are an issue.
We cannot get conditions to work against a checkbox being ticked at all. We have tried True, Checked, Yes etc in the related condition, but it doesn't seem to work. Any ideas?
We have therefore had to use a Checkbox list with only one value on it. This seems to work. however, we have found that it doesn't work if you don't get the Condition on the related form field right first time. If you go in and edit it to the correct value, say, it still fails. We have had to delete the conditions and re-enter them from scratch. In some cases we had to delete the entire form field and start again, and then it would work.
we would still like to be able to use the checkbox to enable conditions against, if possible.
Unfortunately, his "fix" was to use radio buttons instead. That's just not gonna work. I'm not sure about his other comment of using 'false' as the condition value.
It seems to be a problem that comes and goes with Forms updates.
I wish this were prioritized, as HQ can't very well advertise conditions when they don't actually work on the controls you're most likely to use them on.
I'm still looking for a workaround. Guessing that the answer lies somewhere in the UmbracoForms/Assets/umbracoforms-conditions.js file, though there is also some condition logic in UmbracoForms/js/umbraco.forms.js .
Okay, I got this to work for me. It was a problem on my end since I'm using a custom view for front-end rendering. Turns out that it's important to maintain certain classes on the front-end form since they're being used to fetch specific elements in the DOM. Those classes are:
contourPage
contourField
I think these class dependencies should really be listed on the doc page, which mentions that Form.cshtml is customizable. Some thought should also be given to decoupling the default styles from these classes.
@Craig100, your issue is different since I can see that your front-end view very closely resembles the original one and includes the classes I listed above. The problem is that you're missing several scripts that should be included with the package. I think something is amiss with your form picker datatype or macro.
'fraid not. Already have that covered. The only thing I've changed in forms.cshtml is to use ResponsiveBP instead of Bootstrap. Also added a conditional statement to put out the "*indicates madatory field" message (http://issues.umbraco.org/issue/CON-1305). Oh and I'm using more up to date versions of JQuery and the validate scripts, which aren't causing any console errors.
The problem with the conditional action not working has been there out of the box, before I made any other changes and when I was using the script versions declared in the docs (from asp.net CDN).
So you're saying you have conditionals working? Do you have a live example? I'm just about to put some js together to see if I can force it to work.
Unfortunately, I don't have a live version available just yet as we're still in pre-release.
Those jQuery scripts are actually only half of the dependencies. The others are being included by /Views/Partials/Forms/Script.cshtml . They are:
umbracoforms-dependencies.js
umbracoforms.js
umbracoforms-conditions.js
I didn't see those anywhere when I viewed source on your site's form.
It could very well be that those aren't working out of the box, though it's worth noting that Umbraco Forms doesn't actually work out of the box to begin with. Developers are still required to setup a datatype that makes proper use of the form picker. I found documentation to be rather weak in this area, especially when it comes to using the form picker in the grid editor.
I actually found it necessary to include the following snippet in my layout in order to properly load those scripts where I needed them:
@if (TempData["UmbracoForms"] != null)
{
foreach (var form in (List<Guid>)TempData["UmbracoForms"])
{
Html.RenderAction("Render", "UmbracoForms", new { formId = form, mode = "script" });
}
}
Also be sure to add the mode = "form" attribute in your FormPicker view:
I had the mode="form" thing done, because it was clearly in the docs. The other thing, however, was not. Adding your bit of razor got conditionals working for me, so thank you very much.
A slight complication I faced was the form macro being inserted in an RTE rather than in code in the template. Next I'm going to do a PR on the documentation so it's CLEAR! :)
Then after that I'm going to eat humble pie and comment on a few previous posts ;)
Issues with conditions on checkboxes
I posted an issue on here, which seems to have disappeared from the forum - apologies if this ends up being a duplication. The original post was here http://our.umbraco.org/forum/umbraco-pro/contour/39490-Issues-with-conditions-on-checkboxes-form-field-population?p=0#comment144272.
We are running umbraco v 4.11.4 (Assembly version: 1.0.4780.19111), with Contour 3.0.7
We have experienced a number of issues with enabling conditions on our forms (which admittedly are rather complex). Most notably, checkboxes are an issue.
We cannot get conditions to work against a checkbox being ticked at all. We have tried True, Checked, Yes etc in the related condition, but it doesn't seem to work. Any ideas?
We have therefore had to use a Checkbox list with only one value on it. This seems to work. however, we have found that it doesn't work if you don't get the Condition on the related form field right first time. If you go in and edit it to the correct value, say, it still fails. We have had to delete the conditions and re-enter them from scratch. In some cases we had to delete the entire form field and start again, and then it would work.
we would still like to be able to use the checkbox to enable conditions against, if possible.
Thanks
Claire
Have you found a solution for this issue? I'm having exactly the same problem.
Comment author was deleted
Yeah please update to latest WIP version you can find it here
http://nightly.umbraco.org/Umbraco%20Contour/3.0.15%20WIP/
upgrade instructions here
http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Installation/Upgrade
And how is it supposed to be used?
True, Yes, 1 ?
I'm having this issue now with Umbraco Forms 4.1.4 .
I have a checkbox labelled 'Other' that, when checked, should show a textbox. This does not work at all, even with a simple checkbox list.
Hi Matthew,
Have you tried the suggestion that Maurice suggests on this issue http://issues.umbraco.org/issue/CON-712
Hope this works for you.
/Dennis
Thanks for the reply, Dennis.
Unfortunately, his "fix" was to use radio buttons instead. That's just not gonna work. I'm not sure about his other comment of using 'false' as the condition value.
did you find a solution to this?
Im having the same issue with showing textbox conditionally based on selection of radio-button value on other field.
would appreciate if you can shed some light
Linked to this one too: https://our.umbraco.org/forum/umbraco-forms/80761-problem-with-conditional-fields-not-working. There are quite a few unresolved issues in the issue tracker about conditionals not working.
It seems to be a problem that comes and goes with Forms updates.
I wish this were prioritized, as HQ can't very well advertise conditions when they don't actually work on the controls you're most likely to use them on.
I'm still looking for a workaround. Guessing that the answer lies somewhere in the UmbracoForms/Assets/umbracoforms-conditions.js file, though there is also some condition logic in UmbracoForms/js/umbraco.forms.js .
Not to mention it's a "paid for" licence. Or at least it will be when I see it working properly ;)
Hi Craig
Please add your findings to the issue tracker
Thank you
/Dennis
They've been there since 2014... with some recent duplicates.
Already done Dennis ;) :-
http://issues.umbraco.org/issue/CON-1297
http://issues.umbraco.org/issue/CON-712
http://issues.umbraco.org/issue/CON-1037
http://issues.umbraco.org/issue/CON-781
http://issues.umbraco.org/issue/CON-1304
Okay, I got this to work for me. It was a problem on my end since I'm using a custom view for front-end rendering. Turns out that it's important to maintain certain classes on the front-end form since they're being used to fetch specific elements in the DOM. Those classes are:
I think these class dependencies should really be listed on the doc page, which mentions that Form.cshtml is customizable. Some thought should also be given to decoupling the default styles from these classes.
@Craig100, your issue is different since I can see that your front-end view very closely resembles the original one and includes the classes I listed above. The problem is that you're missing several scripts that should be included with the package. I think something is amiss with your form picker datatype or macro.
This page might give you some clues.
Hi Matthew,
'fraid not. Already have that covered. The only thing I've changed in forms.cshtml is to use ResponsiveBP instead of Bootstrap. Also added a conditional statement to put out the "*indicates madatory field" message (http://issues.umbraco.org/issue/CON-1305). Oh and I'm using more up to date versions of JQuery and the validate scripts, which aren't causing any console errors.
The problem with the conditional action not working has been there out of the box, before I made any other changes and when I was using the script versions declared in the docs (from asp.net CDN).
So you're saying you have conditionals working? Do you have a live example? I'm just about to put some js together to see if I can force it to work.
Unfortunately, I don't have a live version available just yet as we're still in pre-release.
Those jQuery scripts are actually only half of the dependencies. The others are being included by /Views/Partials/Forms/Script.cshtml . They are:
I didn't see those anywhere when I viewed source on your site's form.
It could very well be that those aren't working out of the box, though it's worth noting that Umbraco Forms doesn't actually work out of the box to begin with. Developers are still required to setup a datatype that makes proper use of the form picker. I found documentation to be rather weak in this area, especially when it comes to using the form picker in the grid editor.
I actually found it necessary to include the following snippet in my layout in order to properly load those scripts where I needed them:
Also be sure to add the
mode = "form"
attribute in your FormPicker view:Hope this helps.
Hi Matthew,
I had the mode="form" thing done, because it was clearly in the docs. The other thing, however, was not. Adding your bit of razor got conditionals working for me, so thank you very much.
A slight complication I faced was the form macro being inserted in an RTE rather than in code in the template. Next I'm going to do a PR on the documentation so it's CLEAR! :)
Then after that I'm going to eat humble pie and comment on a few previous posts ;)
Good idea, I may be doing the same thing tomorrow.
Glad you got everything working!
is working on a reply...