ImperialSpider
01-19-2006, 07:10 PM
I am trying to call a function with onclick, and have an javascript alert popup immediately following the execution of the function. below is my code...can someone tell me what I need to do to have this function execute, and then immediately have the alert pop up once the function has executed?
Any help would be greatly appreciated...
Thanks,
Imperial Spider
<html>
<head>
<title>PASSWORD CONVERTER</title>
<script language="JavaScript" type="text/javascript">
<!--
var Obj,PassWord,Star,Nu;
function Enter(){
Obj=document.getElementById('passw');
PassWord=Obj.value;
if (PassWord.length<8){
alert('Minimum of Eight Charactors');
return;
}
document.getElementById('mypassw').value=PassWord;
Star='*';
Nu=1;
Change();
}
function Change(){
Obj.value=Star+PassWord.substring(Nu,PassWord.length);
Star+='*';
Nu++;
if (Nu<PassWord.length){ setTimeout('Change()',20) }
else {
Obj.value=Star;
Obj.setAttribute('disabled','disabled');
Obj.style.backgroundColor='silver';
}
}
//-->
</script>
</head>
<body>
Input your password below, and click on the "Convert" button<p>
<input id="passw" size="10"><input type="hidden" id="mypassw" name="mypassw" size="10">
<input type="button" name="" value="Convert" onclick=Enter() "alert('Thank You');">
</html>
Any help would be greatly appreciated...
Thanks,
Imperial Spider
<html>
<head>
<title>PASSWORD CONVERTER</title>
<script language="JavaScript" type="text/javascript">
<!--
var Obj,PassWord,Star,Nu;
function Enter(){
Obj=document.getElementById('passw');
PassWord=Obj.value;
if (PassWord.length<8){
alert('Minimum of Eight Charactors');
return;
}
document.getElementById('mypassw').value=PassWord;
Star='*';
Nu=1;
Change();
}
function Change(){
Obj.value=Star+PassWord.substring(Nu,PassWord.length);
Star+='*';
Nu++;
if (Nu<PassWord.length){ setTimeout('Change()',20) }
else {
Obj.value=Star;
Obj.setAttribute('disabled','disabled');
Obj.style.backgroundColor='silver';
}
}
//-->
</script>
</head>
<body>
Input your password below, and click on the "Convert" button<p>
<input id="passw" size="10"><input type="hidden" id="mypassw" name="mypassw" size="10">
<input type="button" name="" value="Convert" onclick=Enter() "alert('Thank You');">
</html>