JackW Posted October 9, 2012 Share Posted October 9, 2012 (edited) I am developing a website where my client can update the text using simple forms. I have developed several such site using php and a MySQL database. My current client wants to have the ability to add links within the text without typing the full link code. The form I am using to post this question has the function I need. A box pops up where one can put in the url and form a link. Can someone tell me how to create that function for my page? Edited October 9, 2012 by JackW Link to comment Share on other sites More sharing options...
justsomeguy Posted October 9, 2012 Share Posted October 9, 2012 There are several rich text editors available, a popular one is ckeditor. Link to comment Share on other sites More sharing options...
JackW Posted October 9, 2012 Author Share Posted October 9, 2012 Thanks, I may be able to make that work. What I really need is just a simple piece of code that does the link part provided in the rich text editor. That may well not be something that is available. JackW Link to comment Share on other sites More sharing options...
justsomeguy Posted October 9, 2012 Share Posted October 9, 2012 A rich text editor is not a simple piece of code. You can try to extract that one function out of it, but it's going to involve things like getting the highlighted section of text and replacing it with input from a prompt box where you may or may not want it to show an underlined link instead of the HTML code. There's a simpler example here that uses form fields and a regular text area without formatting, if you do some research I'm sure you'll be able to find several other examples: http://stackoverflow.com/questions/3259140/insert-link-url-and-title-text-into-textarea-at-cursor-location-from-form-input 1 Link to comment Share on other sites More sharing options...
JackW Posted October 10, 2012 Author Share Posted October 10, 2012 Thank you, I believe I can work with that and it will do just what I want it to do. JackW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now