Jump to content

Recommended Posts

i was wondering if someone could help me, i was wanting to know where i can find out how to make buttons like the ones above the textarea when u make a topic or reply.  the one that says bold, italics, etc.  i know how to add the text at the end of the edit box but i wanted to know how to add it where the cursor is or around the selected text.

Link to comment
https://forums.phpfreaks.com/topic/65357-form-issue/
Share on other sites

i was wondering if someone could help me, i was wanting to know where i can find out how to make buttons like the ones above the textarea when u make a topic or reply.  the one that says bold, italics, etc.  i know how to add the text at the end of the textarea but i wanted to know how to add it where the cursor is or around the selected text.

 

--sorry for the double post, i hit quote by accident instead of modify.

Link to comment
https://forums.phpfreaks.com/topic/65357-form-issue/#findComment-326371
Share on other sites

That's javascript.

 

<script language="Javascript">
function addBold(){
form.textarea.value += "[b]Your text here[/b]"
}
</script>
<form name="form"><input type="button" value="Bold" onClick="addBold()"><br>
<textarea name="textarea" cols="30" rows="14"></textarea><br><input type="submit">
</form>

Link to comment
https://forums.phpfreaks.com/topic/65357-form-issue/#findComment-327708
Share on other sites

That's javascript.

 

<script language="Javascript">
function addBold(){
form.textarea.value += "[b]Your text here[/b]"
}
</script>
<form name="form"><input type="button" value="Bold" onClick="addBold()"><br>
<textarea name="textarea" cols="30" rows="14"></textarea><br><input type="submit">
</form>

 

well i know how to add it to the end of the textarea, i want it so that it will add it where the cursor is or around text if its highlighted.

Link to comment
https://forums.phpfreaks.com/topic/65357-form-issue/#findComment-327883
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.