Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Java Text Replace

    Hello Folks ! I eventually found the bit you post in lol. I'm not even to sure if this is the correct section or not im only learning i don't know much all i know is its called javascript lol anyways heres my issue.

    PROBLEM
    I cannot seem to find information on how to code a piece of java that replaces text with other characters from a text field.

    AIM
    I aim to get a piece of code that will replace letters that has been entered into a text field after clicking the submit button eg.

    say i enter "hello" into the text field and then clicked submit i would like it to then be converted into "нєllo" in the same text field so the text just changes i would like it to do this for every character in the alphabet so that the writing is in a different style thanks if this is possible.

    a bit like the code below but that just turns it into capitals and lowercase not changing the characters

    2 parts to this script
    ========================================
    place inside head tags
    ========================================
    <script LANGUAGE="JavaScript">
    function ChangeMe(form)
    {
    inputStr=form.Input.value;
    UPPERCASE=inputStr.toUpperCase();
    lowercase=inputStr.toLowerCase();
    form.Upper.value=UPPERCASE;
    form.lower.value=lowercase;
    }
    </script>

    =======================================================
    place in body where you want the script to be viewed
    =======================================================

    <!-- -->
    <form>Enter text:&nbsp;<input TYPE="text" NAME="Input"><br>
    <input TYPE="button" Name="Convert_Button" VALUE="Click to transform to UC and LC" onClick="ChangeMe(this.form)">
    <br>UPPERCASE text:&nbsp;<input TYPE="text" NAME="Upper">
    <br>lowercase text:&nbsp;<input TYPE="text" NAME="lower">
    </form><!-- -->
    Last edited by ryanhouston; 10-16-2008 at 07:11 AM.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by ryanhouston View Post
    say i enter "hello" into the text field and then clicked submit i would like it to then be converted into "нєllo" in the same text field so the text just changes i would like it to do this for every character in the alphabet so that the writing is in a different style
    It is not quite clear what do you mean by "style". Other font-style? Other alphabet (unicode?)? Can you detail, please?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    erm i want it so that the text entered in the form text field will be changed into character map characters of my choice eg.

    change:
    a's to α
    b's to в
    c's to c
    d's to d
    e's to е
    f's to f
    g's to g
    h's to н
    i's to ι
    j's to j
    k's to κ
    l's to ℓ

    these letters that replace are characters that aren't on your keyboard but are in character map

    I also added your MSN address
    Last edited by ryanhouston; 10-16-2008 at 07:43 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •