Select All
Script: (inline)
onclick="javascript:EditForm.EditingArea.focus();EditForm.EditingArea.select()"
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="javascript:EditForm.EditingArea.focus();EditForm.EditingArea.select()">Select All</button>
</form>
Delete All
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
function DeleteText()
{
document.getElementById("EditingArea").value = "";
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="DeleteText()">Delete All</button>
</form>
Remove Line Breaks
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
String.prototype.stripBreaks = function()
{
var matchTag = /\s+/g;
return this.replace(matchTag, " ");
}
function RemoveBreaks()
{
var sourceInput = document.getElementById("EditingArea");
var destInput = document.getElementById("EditingArea");
destInput.value = sourceInput.value.stripBreaks();
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="RemoveBreaks()">Remove Line Breaks</button>
</form>
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
String.prototype.stripHTML = function()
{
var matchTag = /<(?:.|\s)*?>/g;
return this.replace(matchTag, "");
};
function ShowStrippedText()
{
var sourceInput = document.getElementById("EditingArea");
var destInput = document.getElementById("EditingArea");
destInput.value = sourceInput.value.stripHTML();
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="ShowStrippedText()">Remove HTML Tags</button>
</form>
Remove Excess White Space
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
function convertSpaces(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += " ";
flag = 1;
}
}
}
return out;
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="EditForm.EditingArea.value = convertSpaces(EditForm.EditingArea.value);">Remove Excess White Space</button>
</form>
Remove Tab Spaces
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
String.prototype.stripTabs = function()
{
var matchTag = /\t+/g;
return this.replace(matchTag, " ");
}
function RemoveTabs()
{
var sourceInput = document.getElementById("EditingArea");
var destInput = document.getElementById("EditingArea");
destInput.value = sourceInput.value.stripTabs();
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="RemoveTabs()">Remove Tab Spaces</button>
</form>
Convert to Lowercase
Script: Head
<script language="JavaScript" type="text/javascript">
<!--
function makeLowercase()
{
document.EditForm.EditingArea.value = document.EditForm.EditingArea.value.toLowerCase();
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="makeLowercase();">Convert to Lowercase</button>
</form>
Convert Special Characters
Script: Body
<script language="JavaScript" type="text/javascript">
<!--
function specialCharCleanup(specialchartext) {
specialchartext = escape(specialchartext);
if(document.getElementById('preservechar').checked){
specialchartext = specialchartext.replace(/%u201C/g, "“");
specialchartext = specialchartext.replace(/%u201D/g, "”");
specialchartext = specialchartext.replace(/%u2018/g, "‘");
specialchartext = specialchartext.replace(/%u2019/g, "’");
specialchartext = specialchartext.replace(/%u2026/g, "…");
} else {
specialchartext = specialchartext.replace(/%u201C/g, "\"");
specialchartext = specialchartext.replace(/%u201D/g, "\"");
specialchartext = specialchartext.replace(/%u2018/g, "'");
specialchartext = specialchartext.replace(/%u2019/g, "'");
specialchartext = specialchartext.replace(/%u2026/g, "...");
}
specialchartext = specialchartext.replace(/%u2013/g, "–");
specialchartext = specialchartext.replace(/%u2014/g, "—");
specialchartext = specialchartext.replace(/%A9/g, "©");
specialchartext = specialchartext.replace(/%AE/g, "®");
specialchartext = specialchartext.replace(/%u2122/g, "™");
specialchartext = unescape(specialchartext);
document.getElementById('EditingArea').value = specialchartext;
}
//-->
</script>
HTML: Body
<form method="post" action="" enctype="application/x-www-form-urlencoded" name="EditForm">
<textarea name="EditingArea" rows="10" cols="60" id="EditingArea" class="TextBox"></textarea>
<br />
<button type="button" onclick="specialCharCleanup(document.getElementById('EditingArea').value);">Convert to Lowercase</button>
<input type="checkbox" name="preservechar" id="preservechar" class="menu1_checkbox" /><label for="preservechar" id="pc_label">Preserve Entities</label>
</form>