I must confirm the user enters a value for each fund they need. I do not know
how many fund entries there will be...it's expandable to handle each users
needs. I must varify each fund they enter is six digits long. I have no
problems with the Is_In_Format function (I found it on the web and am using
it for other things).
My problem is with my validate function which I've cut down (oh it doesn't
work but you can see the direction I am going with it). Is there a better way
to validate this? If not what am I doing wrong?
function validate() {
for(i=1;i<=nrow ;i++) {
If (eval("!Is_In_F ormat( document.forms[0].fund_" + i + ".value, "dddddd")
|| document.forms[0].fund_" + i + ".value.len gth != 6")){
alert("Fund must be 6 digits");
eval("document. forms[0].fund_" + i + ".focus();" )
}
}
how many fund entries there will be...it's expandable to handle each users
needs. I must varify each fund they enter is six digits long. I have no
problems with the Is_In_Format function (I found it on the web and am using
it for other things).
My problem is with my validate function which I've cut down (oh it doesn't
work but you can see the direction I am going with it). Is there a better way
to validate this? If not what am I doing wrong?
function validate() {
for(i=1;i<=nrow ;i++) {
If (eval("!Is_In_F ormat( document.forms[0].fund_" + i + ".value, "dddddd")
|| document.forms[0].fund_" + i + ".value.len gth != 6")){
alert("Fund must be 6 digits");
eval("document. forms[0].fund_" + i + ".focus();" )
}
}
Comment