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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Field Cache 3

Status
Not open for further replies.
Apr 14, 2004
22
US
Please help us with this one.....
How do you dispose of information in a text field cache?

 
At the top of the page put:
Code:
<%Response.Expires = -1%>
to keep the page from being cached.
 
This is web form vb.aspx.net page. We have a text field of Zipcode that onchange we would like to get a town in the next field. It works when I enter a zipcode and tab it to the next field. However it will not work if I select from the cached zipcodes.

 
Ah, you don't mean the page cache, then, but rather the AutoComplete feature of IE.

First, it's really weird that it has a problem with autocompleted data. My guess is that it must somehow not be triggering some Javascript on the client that needs to be run (though I know almost nothing about ASP.NET -- Forum855, btw).

The only way I know to overcome AutoComplete is to not provide a form field name that the browser recognizes. For example, if your zip code form field name is "zip" then anything the user has ever entered in a form field called "zip" will be available via autocomplete. If, however, the form field was called "zip8378378490" and you used a different random number (or incremented number) every time, there'd be nothing to grab autocomplete info from. Also in the form hide a form field that contains the number appended to field names on the page, so that you'll know what to refer to on the server after submission.

Which is a fair bit of work, certainly, if your problem is a bit of Javascript. The paragraph above is a nifty solution (imo, tooting my own horn) for more dire AutoComplete problems (like forms where users enter sensitive information), but might be a bit much for your little problem. I suggest asking the question over on the ASP.NET forum first.
 
Interesting... a search from Google on [blue]disabling autocomplete with asp" brought up a good article from Microsoft:
It will only work for later browsers, but then again... only later browsers have autocomplete, right?

For IE 5.0 and above, add the following tag to each of your form textfield <input> tags:

Code:
<input autocomplete="off" type="text" name="textfield">

Earnie Eng
 
BTW... this only works for Microsoft's IE browser... don't know about Netscrape

Earnie Eng
 
Y'know, it's funny... I knew about that, but for some reason didn't remember it!

Yeah, use that!!! :)
 
heh... sorry for the bad use of the tgml tag...

thanks for the star!

Earnie Eng
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top