Clear input text

Hi experts, I want to erase all datas stored in the input text. I am using Firefox browser. Every time I type each input text it will remain even I manually the history of the browser. Help please!

<script>
function Clear()
{
  document.getElementById("email").value = ""; //must erase all stored datas
}
</script>
Whing Dela CruzAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
this should work:

<input type="text" name="email" id="email" onfocus="Clear()" />
0
Big MontyWeb Ninja at largeCommented:
this'll clear out the field every time you enter into it
0
Whing Dela CruzAuthor Commented:
Hi Monty, I will try it more, it seems not working on me..
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Big MontyWeb Ninja at largeCommented:
post your code and I can check
0
Whing Dela CruzAuthor Commented:
Hi Monty my input text is inside the table, maybe that's the factor. But anyways, i will post my code in a minute.
0
Whing Dela CruzAuthor Commented:
<!Doctype Html>
<Html>
<body>
   <form name="EnrollForm" method="post" action="Enroll.asp">
       <table id="EnrollTable" class="four">
                  <tr>
                     <td>&nbsp; First Name</td>
                     <td><input type="text" placeholder="First Name" name="cname" required class="i22" id="ccname" maxlength="10" onfocus="Clear()"/></td>
                  </tr>
                  <tr>
                     <td>&nbsp; Last Name</td>
                     <td><input type="text" placeholder="Last Name" name="lname" required class="i22" id="llname" maxlength="12"></td>
                  </tr>
                  <tr>
                     <td>&nbsp; Email</td>
                     <td><input type="email" placeholder="email" id="eml" name="email" required class="i22"></td>
                  </tr>
                  <tr>
                     <td>&nbsp;</td>
                     <td></td>
                  </tr>
                  <tr>
                     <td>&nbsp; Click to Create Account</td>
                     <td><input type="submit" Class="iReg2" value="Create Account" onclick="return ValidateNo()"></td>
                  </tr>

            </Table>

   </form>
</body>
</Html>
0
Big MontyWeb Ninja at largeCommented:
in your original question, it looked like you wanted to use a JS function, but there's none in this code :) no problem, just change your field to:

<input type="text" placeholder="First Name" name="cname" required class="i22" id="ccname" maxlength="10" onfocus="this.value = '';"/>
0
Whing Dela CruzAuthor Commented:
Hi Monty, still not working. I am using Firefox..
0
Big MontyWeb Ninja at largeCommented:
0
Whing Dela CruzAuthor Commented:
I will double check sir, I will feedback you later for any results. Thank you so much!
0
Whing Dela CruzAuthor Commented:
Hi Monty, sorry for not clarifying my questions. Your solution is answered already to my first problem. It clear the field in every time I click it. My next problem is that the data stored on the memory. I guess its memory within the input text. I want them to clear. I attached here the image of the input text where you can see Erwin, John, Jyle and Pedro. Those are the names stored on the textbox. Can I erase them all?

<script>
function Clear()
{
  document.getElementById("email").value = ""; //must erase all stored datas. please see attached image.
}
</script>
error.bmp
0
Big MontyWeb Ninja at largeCommented:
that's actually a function of the browser, and not something that you can programmatically clear out. However, you can disabled that feature using

autocomplete="off"

so you would change your markup to:

<input type="text" placeholder="First Name" name="cname" required class="i22" id="ccname" maxlength="10" onfocus="this.value = '';"  autocomplete="off" />
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Whing Dela CruzAuthor Commented:
Hi Monty its working, Thank you so much!
0
Big MontyWeb Ninja at largeCommented:
my pleasure :)
0
Whing Dela CruzAuthor Commented:
Thanks a lot sir, More power to you and God bless!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.