🧙 Lucian Marin I created an input playground at lucianmarin.com/input where I can test the best ways to input text on Sublevel. Displaying a preview while typing is an option while contenteditable isn't preferable because it allows all kinds of HTML code. I want to create a virtual textarea that maintains cursor position with the actual textarea. Can this be done?
Login or register your account to reply
Mark Dain I might be missing something but couldn't you sanitize the text as it's being displayed?
5y, 35w reply
Paul Webb Eh, I'm not sure. I know you don't want to use contenteditable, but what if you checked the input before submitting? You'd have to do this server-side which is annoying...eh, damn. Okay, textarea is definitely the preferred way, haha! Maybe you can submit your question to StackOverflow? Most people would probably recommend a plugin which I'm sure you don't want either.
5y, 35w 3 replies
🧙 Lucian Marin It seems there's an option for contenteditable="plaintext-only" but only newer browsers supports it. I'll play with this and see how I can clean up the produced HTML. People can still mess around the content with developers tools... hmm.
5y, 35w 2 replies
Haaktu Something like this: jsfiddle.net/RZwmX/1 ?
5y, 36w 1 reply
🧙 Lucian Marin The other way around, textarea being the shadowed element.
5y, 36w reply