Jump to content

Add a link code question


JackW
 Share

Recommended Posts

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 by JackW
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...