I checked in the Forms.cshtml partial view around line 66 there appears to be a condition that will hide the form input label. How do I set this? Is it a "condition" that i have to configure in the admin? how do i configure it? there's no documentation for this that i can find.
You can hide the fields labels on two different ways. The first is to remove this line from the forms.cshtml. You will find the file in /Views/Partials/Forms.
@Html.Raw(f.Caption)
You will find it in line number 77. If you want to choose which labels that should be hidden, you could simply add a class to the label, e.g hide, and the hide it with CSS. like.
Thanks, but I want to be able to set on each item that i have added to the form whether or not to show the label. some FieldTypes i have changed to show the label as a placeholder inside the input, others i want to still display the label.
Perhaps you can extend the field types that Umbraco Forms comes shipped with. The files for the fields types in this folder /Views/Partials/Forms/Fieldtypes
ok thanks, so on line 75 of the Forms.cshtml file where it has "@if (!f.HideLabel)", there's no way to set the value of that? where is it getting the value for that property then?
It is because that you have the possibility to hide and show inputs, depending on some conditions. An example let´s say that you have a check box list where the user can choose how he wants to be concacted, then he can set a tick in phone or email. Depending on which checkbox is check then you can show the phone field or the email field.
I'm pretty sure you have sorted this out by now .. so for people who are new, like me.. I might lay it down as I see it..
If you want to hide a label for a specific field, you are breaking out of the forms standard form types and you need to create a CUSTOM field type.
you can do that in a few easy steps following the the instructions on this page..
Umbraco 7.2 Forms plugin - how to hide label?
I checked in the Forms.cshtml partial view around line 66 there appears to be a condition that will hide the form input label. How do I set this? Is it a "condition" that i have to configure in the admin? how do i configure it? there's no documentation for this that i can find.
thanks.
Hi Matt,
You can hide the fields labels on two different ways. The first is to remove this line from the forms.cshtml. You will find the file in /Views/Partials/Forms.
You will find it in line number 77. If you want to choose which labels that should be hidden, you could simply add a class to the label, e.g hide, and the hide it with CSS. like.
And then in your css
If you mean how you can hide the validation labels, then you can do in the UI for Forms, just click the action button right corner and then validation, in there you will see a checkbox called Hide field validation labels.http://our.umbraco.org/documentation/Products/UmbracoForms/Editor/Creating-a-form/Form-Settings/
Hope this helps,
/Dennis
Thanks, but I want to be able to set on each item that i have added to the form whether or not to show the label. some FieldTypes i have changed to show the label as a placeholder inside the input, others i want to still display the label.
Hi Matt,
Okay then try to have a look on this documentation about how to add settings to a field type.http://our.umbraco.org/documentation/Products/UmbracoForms/Developer/Extending/Adding-a-Type#Addingsettingstoatype and http://our.umbraco.org/documentation/products/umbracoforms/Developer/Extending/Adding-a-Fieldtype.
Perhaps you can extend the field types that Umbraco Forms comes shipped with. The files for the fields types in this folder /Views/Partials/Forms/Fieldtypes
Hope this helps,
/Dennis
ok thanks, so on line 75 of the Forms.cshtml file where it has "@if (!f.HideLabel)", there's no way to set the value of that? where is it getting the value for that property then?
Hi Matt,
It is because that you have the possibility to hide and show inputs, depending on some conditions. An example let´s say that you have a check box list where the user can choose how he wants to be concacted, then he can set a tick in phone or email. Depending on which checkbox is check then you can show the phone field or the email field.
You can read about conditions here: http://our.umbraco.org/documentation/Products/UmbracoForms/Editor/Creating-a-form/Conditional-Logic/
Hope this helps,
/Dennis
Understood. Thanks for your explanation.
I'm pretty sure you have sorted this out by now .. so for people who are new, like me.. I might lay it down as I see it..
If you want to hide a label for a specific field, you are breaking out of the forms standard form types and you need to create a CUSTOM field type. you can do that in a few easy steps following the the instructions on this page..
Adding a field type to Umbraco Forms
All you need to do is add and set this property in the constuctor...
is working on a reply...