I am doing a login form. everytime when i click at the login text box, it will shows the existing user that have logged in before. i want to clear everytime they have login, may i know where i suppose to do?
Hi yytan. You can handle this in different ways, but, anyway this is not a JSP question. You are right, the feature that save the history of the text components is part of the navigator, so it doesn't concern you as a programmer, but concern to the user of your application. Anyway you can avoid this clearing the textbox everytime the page loads with javascript. A function like this will work:
function clear(){
document.forms.yourform.yourtextbox.value="";
}
<BODY onload=javascript:clear();>
But, I'm not sure (and it depends on the browser) if the navigator completes the text before or after the page loads, so the only way to be sure of that is to call this function from the onclick event of the textbox: <input type=text onclick=javascript:clear();>
But you must think about the user's experience in your site.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.