• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

clear textbox after validation?

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
Padre_Corleone
Asked:
Padre_Corleone
1 Solution
 
Harisha M GCommented:
Hi,

field.clear();

or

field.value = "";



---
Harish
0
 
Padre_CorleoneAuthor Commented:
i used

field.value ="";

Thanks so mucho.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now