Forum Moderators: open
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
</head>
<body>
<script type="text/javascript">
/* <![CDATA[ */
function disp_prompt()
{
var ask=prompt("Please enter your weight in kilograms");
{
document.write("Thank-you");
}
}
/* ]]> */
</script>
<h2>Click here to evaluate your weight</h2>
<input type="button" onclick="disp_prompt()" value="Click here" />
</body>
</html>
</code>
does this help in any way...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title><style type="text/css">
#reply {
margin-top:20px;
color:#600;
}
.hide {
display:none;
}
</style><script type="text/javascript">
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
function init(){document.getElementById('mybut').onclick=function() {
disp_prompt();
}
}function disp_prompt(){
document.getElementById('reply').firstChild.nodeValue='';
ask=prompt('Please enter your weight in kilograms.\nSomething like this - "123"','');
if(isNaN(ask)¦¦(ask=='')){
alert('The value entered should be a number, as indicated');
disp_prompt();
}if(ask==null) {
alert('So you are not interested in the project.\nFair enough it will be removed');
document.getElementById('container').className='hide';
return;
}document.getElementById('reply').firstChild.nodeValue=
'The weight that you entered was ' +ask+' kilograms.';
}</script>
</head>
<body><div id="container">
<h2>Click here to evaluate your weight</h2>
<div>
<input id="mybut" type="button" value="Click here">
</div><div id="reply"> </div>
</div>
</body>
</html>