0

Is there a library or widget out there that allows inline editing of certain sections of a paragraph? I have a mad lib like interface that have certain words highlighted. The idea is to allow the user to click on these highlighted sections and then inline edit the words , even supporting an edit field to word wrap around to the next line.

Are there any pre-made widgets or libraries that do this?

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
  • [`contentEditable`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable), maybe? – David Thomas Sep 22 '14 at 16:01
  • It's simple enough with CSS and rendering elements in-line. That's pretty much all you need. – durbnpoisn Sep 22 '14 at 16:01
  • unfortunately it behaves oddly on mobile web, the keyboard comes up but it doesn't seem to update the on screen text. – MonkeyBonkey Sep 22 '14 at 17:25
  • got it working with help from this answer: http://stackoverflow.com/questions/21295698/html5-contenteditable-attribute-not-working-properly-on-ios7-mobile-safari – MonkeyBonkey Sep 22 '14 at 17:29

2 Answers2

0

Assign contentEditable as an attribute to highlighted sections.

Nick Manning
  • 2,828
  • 1
  • 29
  • 50
0

Jeditable matches your criteria perfectly I think. It allows you to define custom styles for what you want to be editable and various events that trigger the textbox to show up. Check out the demo here!

Nischaal Cooray
  • 210
  • 2
  • 12