Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I have a text-field where the user kan enter a phonenumber. They want it displayed like this "4040 5050". in the code it looks like this:
<a href="tel:@Model.Content.GetPropertyValue("phone")">@Model.Content.GetPropertyValue("phone")</a>
But it gives me a error when i check the site ind https://validator.w3.org
Is there a way I can trim the phonenumber so there isn't any space between the numbers?
/Kate
I found the answer here: https://our.umbraco.org/forum/developers/razor/49840-remove-spaces
Try the following:
<a href="tel:@Model.Content.GetPropertyValue("phone").Replace(" ", "")">@Model.Content.GetPropertyValue("phone").Replace(" ", "")</a>
Hi Thanks, It works perfectly :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to trim a phonenumber?
Hi
I have a text-field where the user kan enter a phonenumber. They want it displayed like this "4040 5050". in the code it looks like this:
But it gives me a error when i check the site ind https://validator.w3.org
Is there a way I can trim the phonenumber so there isn't any space between the numbers?
/Kate
I found the answer here: https://our.umbraco.org/forum/developers/razor/49840-remove-spaces
Try the following:
Hi Thanks, It works perfectly :-)
is working on a reply...