Hi
I have this login box that drops down once clicked. I would like it so if the user doesnt click one of the fields within lets say 8 seconds then the box minimizes automatically. Here is what I have:
<script language="javascript">
function makevisible() {
document.getElementById("dropform").style.display="block";
setTimeout("minimize()",4000);
}
function minimize() {
document.getElementById("dropform").style.display="none";
}
</script>
<body>
<ul id="top-navigation">
<li><a <?php if(!isset ($_SESSION['logedin']) || $_SESSION['logedin'] == false) {
echo " id='tn_login' onclick='makevisible()' href='#'>Login";
} else {
echo " id='tn_logout' href='logout.php'><i>Logout</i>";
};
?></a></li>
<li><a href="newuser.php" id="tn_signup">Sign-Up</a></li>
</ul>
<div id="dropform" style="float:left;">
<form action="process.php" method="POST">
<label for="username" style="font-size:10px;">Username</label>
<input type="text" name="user" maxlength="30">
<label for="password" style="font-size:10px;">Password</label>
<input type="password" name="pass" maxlength="30"><br>
<input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; }; ?>>
<b style="font-size:9px; color:#FFFFFF;">Remember Me </b>
<input type="hidden" name="sublogin" value="1">
<div></div>
<input type="image" class="button" src="images/but_login.gif" value="Login" />
</form>
</div>
<?php
if($form->num_errors > 0){
echo "<font size=\"2\" color=\"white\">".$form->num_errors." error(s) found</font>";
};
echo $form->error("user");
echo $form->error("pass");
?>
As you can see I have set a delay once the form is maximized and then go down after 4000. However how do I make it so that the form minimizes if there is no interactivity on the input boxes.
Thanks for any help