Here is what I have now as a base code. Basically, it is two text inputs, one on top of the other. In one, you enter text, and in the other, the text is changed. What I would like to do is have you enter text in one box and in the other, have it turn out like this:
A=B
B=C
C=D
D=F
E=E
F=H
G=G
H=I
I=J
K=K
L=M
M=N
N=P
O=O
P=Q
Q=S
R=R
S=T
T=U
U=V
V=W
W=X
X=Y
Y=Z
Z=A
So for instance, if I entered the word "hi" in the first box and clicked the submit button, in the second box, "ij" would appear.
Here is my base code. Can anyone kindly help me?
A=B
B=C
C=D
D=F
E=E
F=H
G=G
H=I
I=J
K=K
L=M
M=N
N=P
O=O
P=Q
Q=S
R=R
S=T
T=U
U=V
V=W
W=X
X=Y
Y=Z
Z=A
So for instance, if I entered the word "hi" in the first box and clicked the submit button, in the second box, "ij" would appear.
Here is my base code. Can anyone kindly help me?
Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
function encode(text) { Ref="0123456789abcdefghijklmnopqrstuvwxyz.-~ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Result=""
for (Count=0; Count<text.length; Count++) {
Char=text.substring (A=b);
Num=Ref.indexOf (Char);
EncodeChar=Ref.substring(Num+1, Num+2)
Result += EncodeChar
} document.form1.result.value=Result
}
// - End of JavaScript - -->
</SCRIPT>
</HEAD>
<BODY bgcolor="beige">
<FORM name="form1">
<table border=0><tr><td>
Type your word<td><INPUT NAME="input" TYPE=Text><br><td>
<INPUT TYPE=Button VALUE="submit" onClick="encode(this.form.input.value)"><tr><td>
Result:<td><INPUT NAME="result" TYPE=Text>
</table>
</FORM>
</BODY>
</HTML>
Comment