i want this to work in html but the buttons wont click how do you even?
<html>
<script language="VBScript">
Sub Window_OnLoad
Dim width,height
width=700
height=500
self.ResizeTo width,height
End Sub
Function Validate(ID)
On Error Resume Next
Key = Int(pass.value)
If (pass.value = "") Then
X = MsgBox("You have to enter your password..!", 48, "Error")
Else If (tamsg.value = "") Then
X = MsgBox("Enter the text to encrypt or decrypt!", 48, "ERROR!")
Else
Junk = SetTimeOut(KEYS(ID), 1)
End If
End If
End Function
Function KEYS(ID)
text = pass.value
code = 0
Do Until text = ""
code = ((Asc(Left(text, 1)))+code)
text = Replace(text, Left(text, 1), "", "1", "1")
Loop
code = code Mod 420
akey.value = code
Junk = SetTimeOut(ID, 1)
End Function
Function Encrypt
Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
text = tamsg.value
code = ""
key = Int(akey.value)
Do Until text = ""
cnum = Asc(Left(text, 1))
cnum = (cnum+key) Mod 420
num = cnum Mod 26
count = 0
tst = num
Do Until tst = cnum
tst = tst+26
count = count+1
Loop
code = code & Alpha(num) & count
text = Replace(text, Left(text, 1), "", "1", "1")
Loop
tamsg.value = code
End Function
Function Decrypt
Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
text = tamsg.value
code = ""
key = Int(akey.value)
Do Until text = ""
lttr = Left(text, 2)
num = Asc(Left(lttr, 1))-65
chk = Right(lttr, 1)
count = 0
Do Until count = Int(chk)
num = num+26
count = count+1
Loop
num = num-key
Do While num <= 0
num = num+420
Loop
Code = code & Chr(num)
text = Replace(text, Left(text, 2), "", "1", "1")
Loop
tamsg.value = code
End Function
</script>
<input type="hidden" id="akey">
<table align="center" width="400">
<tr> <td align="center">
<textarea id="tamsg" cols="80" rows="15"></textarea>
<input type="password" id="pass">
<input type="button" Value="Encrypt" onClick="Validate('Encrypt')"Encrypt</span>
<input type="button" Value="Decrypt" onClick="Validate('Decrypt')"Decrypt</span>
</html>
What I have tried:
editing the hell out of it but do not know how to go about this btw not my code im noob