473,657 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to clear textfields when browser refresh button cliked in mozilla

2 New Member
hi,
I have login page , userid and password , when i entered values into them and click browser refresh in MOZILLA , password field clears but userid field text doesnt clears, how to clear userid field. in IE both fields clears, problem is with Mozilla only. It's urgent Plz help me.
Feb 11 '09 #1
8 25634
PRR
750 Recognized Expert Contributor
you could clear the text boxes using java script
Expand|Select|Wrap|Line Numbers
  1. function myfunction()
  2. {
  3.  
  4. document.getElementById('TextBox1').value="";
  5.  
  6.  
  7. }
  8. <body onload="myFunction()">
  9.  
Feb 11 '09 #2
Frinavale
9,735 Recognized Expert Moderator Expert
You could also disable ViewState for the user id TextBox.
It will not retain it's values then.

Also, you could clear the text boxes in your server code (in the PreRender event):
Expand|Select|Wrap|Line Numbers
  1.    myUserIdTextBox.Text = ""
  2.    myPassword.Text = ""
Your password field should not keep it's value though, usually this clears automatically if you have indicated that the TextBox is for a password.
Feb 11 '09 #3
bhupinder
32 New Member
@charithstudy


On button click

txtuserid.text= ""
Feb 27 '09 #4
hajoabdul
7 New Member
If the user textbox is not clearing then u might try ds
on ur button click event,
txtUserid.Text = ""
Mar 6 '09 #5
rbuczynski
10 New Member
As you've noticed, this is an issue specific to Netscape/Gecko-based browsers. When you clear the cache from the Tools menu then the issue is resolved. But by default this occurs as a result of the built-in feature called Form and Password Auto-completion.

The suggested solutions given are good, although it seems like a strange function to have to implement. Alternatively, a more precise method is to use the autocomplete attribute in either your FORM element or to each individual INPUT element:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form autocomplete="off">
  3. </form>
  4.  
  5. OR
  6.  
  7. <input type="text" autocomplete="off" />
  8.  
You can read more about it here:
http://devedge-temp.mozilla.org/view.../index_en.html

Can I ask why it's imperative that you have your login page this way?
Mar 11 '10 #6
how can i clear the textfield data while click on the back button to come to old page.
Sep 27 '10 #7
Frinavale
9,735 Recognized Expert Moderator Expert
Hi :)
Welcome to Bytes.

When you hit the back button, the browser displays a version of the page that it cached. Your server-side code cannot detect this and so you cannot use C# or VB.NET code to clear the data.

You can try using meta tags to indicate that the page has expired (as soon as it's sent) and to indicate that no caching should happen. But meta tags are just suggestions and they don't work in all browsers.

The best solution that I have found is to place all of your page controls into an UpdatePanel. This will result in asynchronous postbacks to the server and the browser cannot cache this. So, when the user hits the back button, the page that is displayed is the version of the page that was sent to the browser during the first page request.

-Frinny
Sep 27 '10 #8
@ rbuczynski

Thanks MAN!
it Works ;)
Oct 30 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
14403
by: Andrus Moor | last post by:
I want to add a refresh button to my web page which works like browser refresh button: it must re-load current page from server. How to implement this in javascript ?
7
5652
by: milkyway | last post by:
Hello to all ;-) I am using the Visual Studio 2005 .NET framework. Basically, I have file that is served up as an HTML file on the client side (generated from a .aspx file). But - the HTML file is using javascript to implement a button click (on the client side). Ex: <INPUT onclick="alert('about to start'); process_table('FrmX1',
10
9238
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side click event and I update session information to track the visibilty of some panels in a wizard type navigation ("Next >>" and "<< Back" buttons).. but the refresh button makes another event firing and takes the whole thing to a Choes.. ...
2
2205
by: Jaikanth Sithambaranathan via .NET 247 | last post by:
The problem is in the result page in which i can scroll throughthe contents of the result set 100 at a time. I call the resultpage from a filter page where i accept filter on results to bedisplayed. When i get to the result page by submitting (on clickof a button) from within the filter page or result page theserver understands the calling page using Request.UrlReferrerproerty. When I refresh the page using browser Refresh button,UrlReferrer...
9
4136
by: Navaneet | last post by:
Hi, Can anyone tell me how to prevent some particular POST DATA when refresh button (F5) clicked on server side(vb.net). Thanks Kumar N
1
11324
by: sreedhardasi | last post by:
Hi, I would like to call a javascript function when user clicks on browser's close button. Here is the scenario. 1. User clicks browser close button. 2. User will be displayed a popup or a div with two buttons (Yes or No) by calling a Javascript function 3. "No" will close the window. 4. "Yes" will cancel the user action and redirect him/her to different
4
28746
by: valhalen | last post by:
Hi, I am trying to redirect the user to another page (other than the previous one in the browser's history) when the browser's (IE's) BACK button is clicked. I found this snippet, but am finding it difficult in getting it to run :( if (history.previous) { document.location="page_to_go_bak_to.html"; } Could any of you please provide a small example for the code in page2 and where it should be placed (since I am a novice :))?
4
3279
by: deeas | last post by:
hi , please i have problem and need help when i use visual basic in asp the browser cann't open it i wish you understand me can you help me.
8
3889
rrocket
by: rrocket | last post by:
I have a form that has various tables that are hidden. When the user selects a number from the DDL the corresponding number of tables shows up (using javascript). When the submit button is clicked it carries the values to the next page. The issue is when the user clicks the browser back button the page only shows 1 table (default setup) and not the 3 or 4 it had when it send to the next page. Is there a way to get the page to keep the...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.