Umbraco.CheckBoxList Prevalues commas break strings or remove part of string
Hej there,
I having issue with prevalues when using Umbraco.CheckBoxList data type.
If my prevalue is a string containing commas "," it breaks the string into different line and comma is remove.
Sounds like there is split being done.
Is there a way to resolve this issue am using Umbraco version 7.6.3 assembly: 1.0.6361.21154
Thank you for your kind reply
@Johannes Tak :)
it works thank you very much if i set the prevalue to
We have 2,3 kr to give
I have use @Html.Raw(value.Replace("",", ","))
However that might be not user friendly when inserting values with comma like this.
Is there another approach i can use the commas sign itself in the prevalue
I saw a bug reported
https://issues.umbraco.org/issue/U4-8059
Initially if i set the prevalue "We have 2,3kr to give" with a normal commas , this will split the string into 2 string
I have use @Html.Raw(value.Replace("," ,","))
So i went this approach i change the , to , in the prevalue , and
this result to "We have 2,3kr to give" and in my code i did the following below
@Html.Raw(value.Replace(",,",")) this works but for the user to replace all normal commas to "," , might cause misspelling and does not look great to read .
Hi Johannes ,
I will propose the user to go with a ; instead of . as it is used in the prevalue string sometimes.
But this is an issue with umbraco itself as i understood per related reported bug
https://issues.umbraco.org/issue/U4-8059.
Again thank you very much for your kind help.
Umbraco.CheckBoxList Prevalues commas break strings or remove part of string
Hej there,
I having issue with prevalues when using Umbraco.CheckBoxList data type. If my prevalue is a string containing commas "," it breaks the string into different line and comma is remove.
Sounds like there is split being done. Is there a way to resolve this issue am using Umbraco version 7.6.3 assembly: 1.0.6361.21154 Thank you for your kind reply
What an Interesting behavior!
What about using the html entity for comma?
//Johannes
@Johannes Tak :) it works thank you very much if i set the prevalue to
However that might be not user friendly when inserting values with comma like this. Is there another approach i can use the commas sign itself in the prevalue I saw a bug reported https://issues.umbraco.org/issue/U4-8059
Hmm, shoulden't it just work with
@Html.Raw()
?Just let me doubble check, dose this happen in the backoffice or when you try to print it in your code?
//Johannes
Yes i set the prevalue in the backoffice ,
Initially if i set the prevalue "We have 2,3kr to give" with a normal commas
,
this will split the string into 2 stringSo i went this approach i change the
,
to,
in the prevalue , and this result to"We have 2,3kr to give"
and in my code i did the following belowWhat about using a dot? (".") And then do a String.Replace ? Maybe not ideal but should be more user friendly than using
,
..Hi Johannes , I will propose the user to go with a
;
instead of.
as it is used in the prevalue string sometimes. But this is an issue with umbraco itself as i understood per related reported bug https://issues.umbraco.org/issue/U4-8059. Again thank you very much for your kind help.is working on a reply...