I want two buttons: one for login and another for logout. Initially login button is enabled and logout button is disabled. When I click on login button, the logout button should get enabled and the login button should get disabled. And after that, when i click on logout, the login button should get enabled and the logout button should get disable.
Here's how far I could go with it,but it doesn't work, and that's where I need help!
<script type="text/javascript">
function disable_enable(){
if (document.test.b2.disabled==true)
document.test.b1.disabled=false
if (document.test.b1.disabled==true)
document.test.b1.disabled=true
}
}
</script>
<body>
<form name="test" >
<input type="button" id="login" value="login" name="b1" disabled=false>
<input type="button" id="logout" value="logout" name="b2" disabled=true>
</form>
</body>
</html>

New Topic/Question
Reply



MultiQuote




|