Copied to clipboard

Flag this post as spam?

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


  • mark petty 20 posts 40 karma points
    Apr 04, 2013 @ 16:03
    mark petty
    0

    Help Output checkbox list values

    Hi All

    I am fairly new to this so i'm sorry if it appears very simple.

    In the administration I have created a new data type for a Checkbox list.
    I have assigned this data type to a property in a document type. This allows the admin user to select multiple checkboxes.

    All i'm trying to do is output the selected values on to a page.

    I've tried the following but I just get blank values back (unless I select one item):

    <umbraco:Macro runat="server" language="cshtml">
    @{
    @Model.GetProperty("availableTo").Value
    }
    </umbraco:Macro>

    I've searched every where but I cannot find any help?

     

    Thanks

  • mark petty 20 posts 40 karma points
    Apr 04, 2013 @ 17:42
    mark petty
    0

    Sorry I was meant to put .ToString() at the end.

    <umbraco:Macro runat="server" language="cshtml">
     
     @Model.GetProperty("availableTo").Value.ToString()
     
    </umbraco:Macro>

     

    With the above if I select one checkbox item from 'availableTo' it works fine. If I select 2 or more it comes back empty.

    Any idea how I can output one or more values?

    Thanks

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 10:24
    mark petty
    0

    Any help would be much appreciated?

    Just need to out out the content of a checkbox list selected values.

    Thank you

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 11:28
    mark petty
    0

    I have checked the content of the umbraco.config and even though I have checked 2 check boxes i'm getting the following:

    <availableTo><![CDATA[]]></availableTo>

    Why would this be empty when I select more than one item? if I check one box it is fine.

    This is very confusing

     

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 05, 2013 @ 11:32
    Dave Woestenborghs
    0

    A few questions

    - What umbraco version are you using ?

    - How did you configure your checkbox list datatype. Can you provide a screen shot

    Dave

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 11:36
    mark petty
    0

    Hi Dave

    Thanks for your help.

    Its version 6.0.2

    This is the created data type:

    I have changed the name to Campus (as oppose to availableTo).

    Mark

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 11:47
    mark petty
    0

    Then I add the property to the document type:

    This then allows the user to select the check boxes:

     

    If I select one item I get the following: <campus><![CDATA[Test 1]]></campus>

    If I select two items I get the following: <campus><![CDATA[]]></campus>

     

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 05, 2013 @ 11:51
    Dave Woestenborghs
    0

    Strange,

    I just tried to reproduce this on a 6.0.0 and 6.0.3 install. Everything seems to work fine.

    Dave

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 11:54
    mark petty
    0

    Cheers Dave for your help. I will try to upgrade to the 6.0.3 install.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 05, 2013 @ 11:57
    Dave Woestenborghs
    0

    Hi Mark,

    I just checked the issue tracker and it seems it was a bug in 6.0.2 and 4.11.5

    http://issues.umbraco.org/issue/U4-1882

    A upgrade to 6.0.3 would fix the problem

    Dave

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 12:00
    mark petty
    0

    That's great Dave. I really appreciate your help as I was going out of my mind.

    I feel like i have been googling for hours and hours and was getting no where.

    Thank you!!

  • mark petty 20 posts 40 karma points
    Apr 05, 2013 @ 12:23
    mark petty
    0

    That worked!!

    Thanks Dave

Please Sign in or register to post replies

Write your reply to:

Draft