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();

}
}
LVL 7
Padre_CorleoneAsked:
Who is Participating?
 
Harisha M GConnect With a Mentor Commented:
Hi,

field.clear();

or

field.value = "";



---
Harish
0
 
Padre_CorleoneAuthor Commented:
i used

field.value ="";

Thanks so mucho.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.