Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear text box history 1

Status
Not open for further replies.

yytan

Programmer
May 8, 2002
113
MY
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?

is it in my program or in the IE setting?
 
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.

Hope it helps.
 
To pedrosolorzano ;

thanks for your detail explanation, i am cleared of it now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top