<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#err{display:none;width:500px;text-align:center;padding:10px;margin:5px;border:1px solid #ff0000;}
#step2{display:none;}
#submit{display:none;}
</style>
<script type="text/javascript">
/* <![CDATA[ */
var getel = function(el){return document.getElementById(el);}
function conf(){
getel('txt1_h').value = getel('txt1').value;
getel('txt2_h').value = getel('txt2').value;
getel('txt1').value = "******";
getel('txt1').readOnly = 'readonly';
getel('txt2').value = "******";
getel('txt2').readOnly = 'readonly';
getel('step2').style.display = 'block';
getel('confirm').style.display = 'none';
getel('submit').style.display = 'block';
}
function finalize(){
if(getel('txt3').value == getel('txt1_h').value && getel('txt4').value == getel('txt2_h').value){
return true;
}else{
getel('err').style.display = 'block'
getel('txt1').readOnly = '';
getel('txt2').readOnly = '';
getel('txt1').value = getel('txt2').value = getel('txt1_h').value = getel('txt2_h').value = getel('txt3').value = getel('txt4').value = '';
getel('step2').style.display = 'none';
getel('confirm').style.display = 'block';
getel('submit').style.display = 'none';
return false;
}
}
/* ]]> */
</script>
</head>
<body>
<form action="" method="get" onsubmit="return finalize();">
<div>
<div id="err">The entered values did not match, please re-enter.</div>
<div id="step1">
<label for="txt1">Enter Text1:</label>
<input id="txt1" name="txt1" type="text" />
<input id="txt1_h" name="txt1_h" type="hidden" />
<label for="txt2">Enter Text2:</label>
<input id="txt2" name="txt2" type="text" />
<input id="txt2_h" name="txt2_h" type="hidden" />
</div>
<div id="step2">
<label for="txt3">Reenter Text1</label>
<input id="txt3" name="txt3" type="text" />
<label for="txt4">Reenter Text2</label>
<input id="txt4" name="txt4" type="text" />
</div>
<input id="confirm" onclick="conf();" type="button" value="Confirm" />
<input id="submit" type="submit" value="Submit" />
</div>
</form>
</body>
</html>
|