Jump to content

form issue


cha0sriderx

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.