Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Torbjørn 12 posts 32 karma points
    Oct 21, 2011 @ 15:56
    Torbjørn
    0

    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?)

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 21, 2011 @ 16:08
    Tom Fulton
    0

    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

  • Torbjørn 12 posts 32 karma points
    Oct 23, 2011 @ 19:27
    Torbjørn
    0

    Thanks Tom,

    I assume I can use both methods. Master document is probably the simplest for the administrators to relate to, I would assume.

Please Sign in or register to post replies

Write your reply to:

Draft