Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Need help with javascripts please
Old 03-27-2007, 01:27 PM Need help with javascripts please
Junior Talker

Posts: 2
Trades: 0
Hi, please copy this code and run on your editor and see sample, as you can see this sample and I'm trying to make change code to add text field for the first name and then show the Decrypting Text Effect, I have tried that and I could not figure out how that can be done.

I need your help to see if you be able to make change code by add text text field for the first name when person enter first name and click button to show Decrypting Text Effect of first name.


<html>
<head>
<title>Decrypting Text Effect</title>
<style>
a:visited{color:black;font-family:verdana}
a:link{color:black;font-family:verdana}
a:hover{color:blue;font-family:verdana}

td {color:black;font-family:verdana;font size:8pt}
p {color:black;font-family:verdana;font size:8pt;text-decoration: none}
h1 {color:black;font-family:verdana;font size:12pt;text-decoration: none}
</style>

<script>
var got;
var chars;
function change()
{
var randstring = "";
var rslength = chars.length - got.length;

var decrypted = document.getElementById("decoded");
var encrypted = document.getElementById("encoded");

for(var x=0;x<rslength;x++)
{
i = Math.floor(Math.random() * chars.length);
randstring += chars.charAt(i);
}

if(randstring.charAt(0) == chars.charAt(got.length))
{
got += randstring.charAt(0);
decrypted.innerHTML = got;
}
else
{
encrypted.innerHTML = randstring;
}

if(chars.length > got.length)
{
setTimeout("change()", 10);
}
else
{
encrypted.innerHTML = "";
}
}
function startdecrypt()
{
var decrypted = document.getElementById("decoded");
var encrypted = document.getElementById("encoded");

chars = decrypted.innerHTML;
decrypted.innerHTML = "";
got = "";
setTimeout("change()", 10);
}
</script>
</head>
<body onLoad="javascript:startdecrypt()">
<h1>&nbsp;</h1>
<p>
<span id="decoded">Your text goes here.</span><span id="encoded"></span>
</p>
<p>
<input type="button" onClick="javascript:startdecrypt()" value="Start">
</p>
</body>
</html>
Alidad@comcast. is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-28-2007, 04:51 PM Re: Need help with javascripts please
Junior Talker

Posts: 2
Name: Mike
Trades: 0
I think this is what you were asking for. If not let me know.

Code:
<html> 
<head> 
<title>Decrypting Text Effect</title> 
<style> 
a:visited{color:black;font-family:verdana} 
a:link{color:black;font-family:verdana} 
a:hover{color:blue;font-family:verdana} 

td {color:black;font-family:verdana;font size:8pt} 
p {color:black;font-family:verdana;font size:8pt;text-decoration: none} 
h1 {color:black;font-family:verdana;font size:12pt;text-decoration: none} 
</style> 

<script> 
var got; 
var chars; 
function change() 
{ 
var randstring = ""; 
var rslength = chars.length - got.length; 

var decrypted = document.getElementById("decoded"); 

for(var x=0;x<rslength;x++) 
{ 
i = Math.floor(Math.random() * chars.length); 
randstring += chars.charAt(i); 
} 

if(randstring.charAt(0) == chars.charAt(got.length)) 
{ 
got += randstring.charAt(0); 
decrypted.value = got; 
} 
else 
{ 
var solved =decrypted.value;
decrypted.value = solved+randstring; 
} 

if(chars.length > got.length) 
{ 
setTimeout("change()", 10); 
 } 
} 
function startdecrypt() 
{ 
var decrypted = document.getElementById("decoded"); 

chars = decrypted.value; 
decrypted.value = ""; 
got = ""; 
setTimeout("change()", 10); 
} 
</script> 
</head> 
<body onLoad="javascript:startdecrypt()"> 
<h1>&nbsp;</h1> 
<p> 
<span><input id="decoded" name="decoded" type="text" value="Your text goes here"></span>
</p> 
<p> 
<input type="button" onClick="javascript:startdecrypt()" value="Start"> 
</p> 
</body> 
</html>
mike@parterns is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help with javascripts please
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10142 seconds with 12 queries