topical media & game development

talk show tell print

#javascript-form-convert-characters.htm / htm



  
  <!-- TWO STEPS TO INSTALL EXTENDED CHARACTERS:
  
    1.  Copy the coding into the HEAD of your HTML document
    2.  Add the last code into the BODY of your HTML document  -->
  
  <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  
  <HEAD>
  
  <SCRIPT LANGUAGE="JavaScript">
  <!-- Original:  Jeffery P. Sanders (jeff.sanders@centurytel.net) -->
  <!-- Web Site:  http://fp1.centurytel.net/JPS -->
  
  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  
  <!-- Begin
  var thisString;
  function startText() {
  thisString = document.HackerText.box1.value;
  thisString = thisString.replace(/A/g, "Ä");
  thisString = thisString.replace(/B/g, "ß");
  thisString = thisString.replace(/C/g, "Ç");
  thisString = thisString.replace(/D/g, "Ð");
  thisString = thisString.replace(/E/g, "È");
  thisString = thisString.replace(/F/g, "£");
  thisString = thisString.replace(/I/g, "Ì");
  thisString = thisString.replace(/N/g, "ñ");
  thisString = thisString.replace(/O/g, "Ö");
  thisString = thisString.replace(/P/g, "þ");
  thisString = thisString.replace(/S/g, "§");
  thisString = thisString.replace(/T/g, "†");
  thisString = thisString.replace(/U/g, "Ú");
  thisString = thisString.replace(/X/g, "×");
  thisString = thisString.replace(/Y/g, "¥");
  thisString = thisString.replace(/a/g, "å");
  thisString = thisString.replace(/b/g, "ß");
  thisString = thisString.replace(/c/g, "¢");
  thisString = thisString.replace(/d/g, "Ð");
  thisString = thisString.replace(/e/g, "ê");
  thisString = thisString.replace(/f/g, "£");
  thisString = thisString.replace(/i/g, "ï");
  thisString = thisString.replace(/n/g, "ñ");
  thisString = thisString.replace(/o/g, "ð");
  thisString = thisString.replace(/p/g, "þ");
  thisString = thisString.replace(/s/g, "§");
  thisString = thisString.replace(/t/g, "†");
  thisString = thisString.replace(/u/g, "µ");
  thisString = thisString.replace(/y/g, "¥");
  thisString = thisString.replace(/1/g, "¹");
  thisString = thisString.replace(/2/g, "²");
  thisString = thisString.replace(/3/g, "³");
  thisString = thisString.replace(/5/g, "5");
  thisString = thisString.replace(/0/g, "Ø");
  document.HackerText.box2.value=thisString;
  }
  //  End -->
  </script>
  
  </HEAD>
  
  <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  
  <BODY>
  
  Enter Text to Convert In the Box Below then Press the Convert Button
  <form name="HackerText">
  <input type="text" size="70" name="box1">
  <br>
  Converted Text
  <br>
  <input type="text" size="70" name="box2">
  <br>
  <input type="button" value="Convert" onclick="startText();">
  </form>
  
  <p><center>
  <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
  by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  </center><p>
  
  <!-- Script Size:  2.72 KB -->


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.