Solved

clear textbox after validation?

Posted on 2006-07-20
2
207 Views
Last Modified: 2012-06-22
this will validate my rows, but how can i instead of selecting the entry clear the field instead?


function validate(field) {
var iRow = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (iRow.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry! Only numeric values allowed");
field.focus();
field.select();

}
}
0
Comment
Question by:Padre_Corleone
2 Comments
 
LVL 37

Accepted Solution

by:
Harisha M G earned 500 total points
ID: 17149765
Hi,

field.clear();

or

field.value = "";



---
Harish
0
 
LVL 7

Author Comment

by:Padre_Corleone
ID: 17149824
i used

field.value ="";

Thanks so mucho.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where do I learn ES6? 3 48
Angular 2 - Issue in page Layout 2 46
Download a website to hdd 2 47
highcharts wont fix inside a bootstrap modal window 6 26
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now