barathymathialagan
Programmer
I need some help in javascript.
This is my function.
It validate the text, but it is not focusing on the text, after validation. focus goes to the next textbox.
function validatefn(field)
//function is called when the text is changed
{
var dblNum;
var txtText;
var txtMessage;
dblNum = 0.1;
if(!isNaN(field.value)) /* Checks to see if it is a number (isNaN: Not a Number) */
{
dblNum = field .value; /* alerts display message boxes */
}
else
{
alert("Please enter number without commas or dollar signs. ");
}
{
fieldFocus();
field.select();
}
}
This is the textbox
<input type="text" name="txtActRevenue" size="20"
onChange = "validatefn(this);" >
It validate the text, but it is not focusing on the text, after validation. focus goes to the next textbox.
How can I correct?
Barathy
This is my function.
It validate the text, but it is not focusing on the text, after validation. focus goes to the next textbox.
function validatefn(field)
//function is called when the text is changed
{
var dblNum;
var txtText;
var txtMessage;
dblNum = 0.1;
if(!isNaN(field.value)) /* Checks to see if it is a number (isNaN: Not a Number) */
{
dblNum = field .value; /* alerts display message boxes */
}
else
{
alert("Please enter number without commas or dollar signs. ");
}
{
fieldFocus();
field.select();
}
}
This is the textbox
<input type="text" name="txtActRevenue" size="20"
onChange = "validatefn(this);" >
It validate the text, but it is not focusing on the text, after validation. focus goes to the next textbox.
How can I correct?
Barathy