Jump to content

Make submit interact with textarea


hlstriker

Recommended Posts

Hello everyone, I am trying to make something like the forums where you are making a thread and there are the Bold, Italic, Underline, Quote, etc buttons that add stuff to the textarea.

So far I have my form all ready, but I don't even know where to start to make the buttons interact with the textarea. I figured this would be using PHP too, but i'm not to sure.

Here is the code I have so far, and am wondering if someone could change this to make the buttons work with the textarea, and explain what it does.

[code]<form name="newssubmit" action="BLAHBLAHBLAH" method="POST">
<table border="1" cellspacing="0" cellpadding="5"><tr><td>

<input type="text" name="title" value="Enter News Title" size="38"></td></tr>

<tr><td>
        <input type="submit" name="bold" value="B">
        <input type="submit" name="italic" value="i">
        <input type="submit" name="underline" value="u">
        <input type="submit" name="break" value="Break">
        <input type="submit" name="quote" value="Quote">
        <input type="submit" name="image" value="Img">
        <input type="submit" name="url" value="URL">
</td></tr>

<tr><td>
        <textarea cols="58" rows="15" name="text">
        Enter news here.
        </textarea>
</td></tr>

<tr><td>
<input type="submit" name="add" value="Add News"><br>
</td></tr>

</table>
</form>[/code]

So for example, the user should be able to enter text in the textarea, then highlight the text, push a Bold (or other) button, and it will put the bold html tags around it.

Thanks in advance!
Link to comment
Share on other sites

Not sure if HTMLarea is still available for free ... but TinyMCE is free from [a href=\"http://tinymce.moxiecode.com/\" target=\"_blank\"]http://tinymce.moxiecode.com/[/a]. It's a simple javascript textarea editor.
Link to comment
Share on other sites

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]TinyMCE is free from [a href=\"http://tinymce.moxiecode.com/\" target=\"_blank\"]http://tinymce.moxiecode.com/[/a].[/quote]
Ahh.... thats the one I was thinking of anyways. Been so long since Ive done any web work that I'de forgotten what It was called.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.