shield
03-22-2005, 10:51 AM
Im creating a script where people can submit things like tutorials. These tutorial contain examples of code and I therefore want to make that bit of code stand out from the rest when its being viewed. So what ive done is ive created a php script which take the input from a form once its submitted and then replaces certain tags which I have created with tags to make it stand out.
So basically what I need is a text box with some formatting buttons above it. If someone for example clicks on the CODE button the [CODE] tag will be inserted into the appropiate place in the text box. Then the next time someone clicks on that button it will then insert the closing tag which is the same but with a / before the CODE word.
Also if text is selected within the text box clicking on one of the formatting bttons will need to surround the selected text with the appropiate tags.
This works just like the posting form here on this forum.
The tags needed are:
BOLD
ITALIC
UNDERLINE
CODE
IMG
I can do the php side myself.. Al I need is the javascript which inserts the tags into the text box.
Thanks
So basically what I need is a text box with some formatting buttons above it. If someone for example clicks on the CODE button the [CODE] tag will be inserted into the appropiate place in the text box. Then the next time someone clicks on that button it will then insert the closing tag which is the same but with a / before the CODE word.
Also if text is selected within the text box clicking on one of the formatting bttons will need to surround the selected text with the appropiate tags.
This works just like the posting form here on this forum.
The tags needed are:
BOLD
ITALIC
UNDERLINE
CODE
IMG
I can do the php side myself.. Al I need is the javascript which inserts the tags into the text box.
Thanks