ShootingBlanks Posted September 24, 2007 Share Posted September 24, 2007 How would I go about making buttons (much like the ones above where you type posts/replies on this or any other message board) that would insert HTML code for: <b>, <i>, <u> etc, wherever the user's cursor is at within the text field?... Is that even PHP? Or another web technology all together? Thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/ Share on other sites More sharing options...
pocobueno1388 Posted September 24, 2007 Share Posted September 24, 2007 That would be JavaScript. You would have to create a function to add the text when clicked, then on the image they click, put an onClick function. If I could help you more, I would...I would post this in the JavaScript forum though, you will get much more help. Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/#findComment-354187 Share on other sites More sharing options...
ShootingBlanks Posted September 24, 2007 Author Share Posted September 24, 2007 Thanks - i will do that right now! Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/#findComment-354198 Share on other sites More sharing options...
AdRock Posted September 24, 2007 Share Posted September 24, 2007 You can try using what I have....i got it from other sites and got most of it working [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/#findComment-354284 Share on other sites More sharing options...
ShootingBlanks Posted September 24, 2007 Author Share Posted September 24, 2007 You can try using what I have....i got it from other sites and got most of it working Thanks, AdRock... ...both "editor.htm" and "editor2.htm" don't seem to work when opened in a browser (nothing happens when you click the tag buttons). Are they supposed to work? I just want to make sure that I'm looking at the right thing before I start picking apart this code. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/#findComment-354305 Share on other sites More sharing options...
ShootingBlanks Posted September 24, 2007 Author Share Posted September 24, 2007 I am also noticing that once you click a button to open the code, no matter how many times you click it again, the button text does not revert back to its original state (as though the tag were closed). Quote Link to comment https://forums.phpfreaks.com/topic/70510-bolditalicunderline-buttons-for-text-field/#findComment-354327 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.