rtnMichael
Programmer
Hey guys, is it any different to validate floats as it is to validate integers? I have a form with three text boxes: upper and lower specs and an input box for a user input value. For example, an upper is 1.2345 and a lower is 1.0293. I want to check to see if the value input is between the two specs. Would it be any different to check against these values because they're floats?
Thanks
Mike
Here's what I have, don't know if it's right....well, can actually say it doesn't work right, I don't get the desired Pass/Fail I want.
function figurepassfail(ValueArr, Value_LowerArr, Value_UpperArr, max_parms)
{
var j = 0;
var flag;
PassFailArr = new Array();
while(j < max_parms)
{
flag = true;
if(!ValueArr[j])
{
}
else
{
//just to test if the uppers and lowers exist
if(Value_UpperArr[j] && Value_LowerArr[j])
{
if((ValueArr[j] > Value_UpperArr[j]) || (ValueArr[j] < Value_LowerArr[j]))
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
else if(Value_UpperArr[j] && !Value_LowerArr[j])
{
if(ValueArr[j] > Value_UpperArr[j])
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
else if(Value_LowerArr[j] && !Value_UpperArr[j])
{
if(ValueArr[j] < Value_LowerArr[j])
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
}
j = j + 1;
}
document.form3.PassFail_str.value = PassFailArr;
return flag;
}
Thanks
Mike
Here's what I have, don't know if it's right....well, can actually say it doesn't work right, I don't get the desired Pass/Fail I want.
function figurepassfail(ValueArr, Value_LowerArr, Value_UpperArr, max_parms)
{
var j = 0;
var flag;
PassFailArr = new Array();
while(j < max_parms)
{
flag = true;
if(!ValueArr[j])
{
}
else
{
//just to test if the uppers and lowers exist
if(Value_UpperArr[j] && Value_LowerArr[j])
{
if((ValueArr[j] > Value_UpperArr[j]) || (ValueArr[j] < Value_LowerArr[j]))
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
else if(Value_UpperArr[j] && !Value_LowerArr[j])
{
if(ValueArr[j] > Value_UpperArr[j])
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
else if(Value_LowerArr[j] && !Value_UpperArr[j])
{
if(ValueArr[j] < Value_LowerArr[j])
{
flag = false;
PassFailArr[j] = "Fail";
}
else PassFailArr[j] = "Pass";
}
}
j = j + 1;
}
document.form3.PassFail_str.value = PassFailArr;
return flag;
}