Thanks Michael, but that doesn't work either...it's like my script can't
detect any account elements except the first one. I've been trying to get
access to the information for other scripts and can't...the only thing I can
do is collect the information after the page has been submitted.
I use the follow script to create text boxes when a person wants to add an
function addacc(num) {
var del1 = document.getEle mentById(num)
var stuff;
var arow = num * (-1);
document.RFO.ar ow.value=arow;
document.all.Ac cAmt.style.visi bility="visible ";
document.all.Ac cTot.style.visi bility="visible ";
document.RFO.ac c_tot_1.value=" Balance";
document.RFO.ac c_tot_1.disable d="true";
stuff = "<table><tr ><td width=\"70\"><i nput type=\"text\" size=\"5\"
name=\"fund_" + arow + "\" class=\"regSoft \">"
stuff = stuff + "</td><td width=\"70\"><i nput type=\"text\" size=\"5\"
name=\"org_" + arow + "\" class=\"regSoft \">"
stuff = stuff + "</td><td width=\"70\"><i nput type=\"text\" size=\"5\"
name=\"program_ " + arow + "\" class=\"regSoft \">"
stuff = stuff + "</td><td width=\"50\"><i nput type=\"text\" size=\"2\"
name=\"activity _" + arow + "\" class=\"regSoft \">"
stuff = stuff + "</td><td width=\"70\">"
stuff = stuff + "<input name=\"acc_tot_ " + arow + "\" type=\"text\"
class=\"regSoft \" size=\"5\">"
stuff = stuff + "</td></tr></table>"
num = num - 1;
stuff = stuff + "<div id=\"" + num + "\" style=\"visibil ty:visible\">"
stuff = stuff + "<A onClick=\"javas cript:addacc(" + num +")\"><u
class=\"regSoft \"><font color=\"blue\"> Add Account</font></u></a></div>"
del1.innerHTML = stuff
}
Michael Winter <M.******@bluey onder.co.invali d> writes:
On Fri, 23 Jan 2004 09:57:13 -0600, <ab*******@hotm ail.com> wrote:
for(i = document.RFO.ar ow.value; i > 1 ; i--){
if (document.RFO.a cct_tot_i.value ==""){
alert("Need Amount For Each Account Used");
document.RFO.ac ct_tot_i.focus( );
}
}
The problem seems to be with the if statement...I'v e also tried
if (document.RFO.a cct_tot_(i).val ue ==""){
alert("Need Amount For Each Account Used");
document.RFO.ac ct_tot_(i).focu s();
}
Try:
if( '' == document.forms['RFO'].elements['acct_tot_' + i].value ) {
alert( 'Need amount for each account used.' );
document.forms['RFO'].elements['acct_tot_' + i].focus();
}
The 'if' expression could also be written
if( !document.forms['RFO'].elements['acct_tot_' + i].value ) {
Mike