I have this textfield with maxlenght set to 255. The users' input will be displayed on the frontend. If the user has entered a link in the text, the actual displayed text is a lot shorter then the allowed 255 chars.
How can I let the user input text that will be DISPLAYED as max255 chars
Example: say maxlength=50
input: My <a href='our.umbraco.org'>umbraco</a> is great! length: 50 chars
desplayed like this: This is umbraco! length: 16 chars
I want the user to be able to enter text that will be displayed as max 50 char
Well, actually, I don't care, but my customer does.
Oh yeah, Striphtml is a good idea actually... but it would have to be called on every change of the textbox's content.... could be done by a ajax call... hmmm
Actual Max length of <input type="text"> element
I have this textfield with maxlenght set to 255. The users' input will be displayed on the frontend. If the user has entered a link in the text, the actual displayed text is a lot shorter then the allowed 255 chars.
How can I let the user input text that will be DISPLAYED as max255 chars
Example: say maxlength=50
input: My <a href='our.umbraco.org'>umbraco</a> is great!
length: 50 chars
desplayed like this: This is umbraco!
length: 16 chars
I want the user to be able to enter text that will be displayed as max 50 char
Well, actually, I don't care, but my customer does.
Any idea's ?
Is XSLT substring function an option?
substring (string, number, number?)
How do they enter links? Do the input the full HTML link, or just some kind of Markdown/Textile variant?
Since the actual text length can not be expressed as (entered text + X chars) it makes it hard to define a set maximum on the field...
The StripHtml() function in umbraco.library would be able to help you calculate, though...
/Chriztian
Oh yeah, Striphtml is a good idea actually... but it would have to be called on every change of the textbox's content.... could be done by a ajax call... hmmm
is working on a reply...