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):
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
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
Any help would be much appreciated?
Just need to out out the content of a checkbox list selected values.
Thank you
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
A few questions
- What umbraco version are you using ?
- How did you configure your checkbox list datatype. Can you provide a screen shot
Dave
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
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>
Strange,
I just tried to reproduce this on a 6.0.0 and 6.0.3 install. Everything seems to work fine.
Dave
Cheers Dave for your help. I will try to upgrade to the 6.0.3 install.
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
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!!
That worked!!
Thanks Dave
is working on a reply...