...

View Full Version : Java Text Replace



ryanhouston
10-16-2008, 08:08 AM
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><!-- -->

Kor
10-16-2008, 04:37 PM
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?

ryanhouston
10-16-2008, 08:35 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum