Changing the input fields based on a selection list
Hi,
I have a document with multiple generic properties. Based on an initial selection in a list-box I would like to dynamically hide certain input fields. Can I do this in Umbraco? If yes, how?
Thanks!
(An example: if I create a new article, and the administrator wants to create the article as an external link without bodytext, how can I dynamically hide the body text input field if another property/input field "external link" is populated?)
There's not really an quick/easy way to do this, I suppose you might be able to achieve it with ApplicationBase and some custom C#/JS, but not very cleanly/easily. It's definatley possible (see Axendo Disabled Properties package, but might take some work to make it dependent on other fields).
Probably the best way to handle this is to create two seperate document types, ex: News Article - Content, and News Article - Link. Or, you could create one document type and just add in notes "If you fill out the link, the content below will not be shown"...etc.
I recently had the same situation and did it using the first way (two document types). One thing that helps, if there is a common set of fields that all News Articles should have, you can create a master document type that both inherit from:
In the same site I also had a document type for a list of countries, some which had links and some which had content in Umbraco. In this case I used the second method, explaining in the notes of the External Link field that if you fill this out, the content below will not be shown.
Changing the input fields based on a selection list
Hi,
I have a document with multiple generic properties. Based on an initial selection in a list-box I would like to dynamically hide certain input fields. Can I do this in Umbraco? If yes, how?
Thanks!
(An example: if I create a new article, and the administrator wants to create the article as an external link without bodytext, how can I dynamically hide the body text input field if another property/input field "external link" is populated?)
Hi,
There's not really an quick/easy way to do this, I suppose you might be able to achieve it with ApplicationBase and some custom C#/JS, but not very cleanly/easily. It's definatley possible (see Axendo Disabled Properties package, but might take some work to make it dependent on other fields).
Probably the best way to handle this is to create two seperate document types, ex: News Article - Content, and News Article - Link. Or, you could create one document type and just add in notes "If you fill out the link, the content below will not be shown"...etc.
I recently had the same situation and did it using the first way (two document types). One thing that helps, if there is a common set of fields that all News Articles should have, you can create a master document type that both inherit from:
News Master (newsDate, newsHeadline, etc)
- News Article - Content (bodyText)
- News Article - Link (newsUrl)
In the same site I also had a document type for a list of countries, some which had links and some which had content in Umbraco. In this case I used the second method, explaining in the notes of the External Link field that if you fill this out, the content below will not be shown.
Hope this helps,
Tom
Thanks Tom,
I assume I can use both methods. Master document is probably the simplest for the administrators to relate to, I would assume.
is working on a reply...