Forum Moderators: open
im wanting to clear a whole load of fields in a form, all these fields have either 'ret' ¦¦ 'Ret' on their name.
so i tried this
for (i=0;i<document.forms[0].elements.length;i++){
if (document.forms[0].elements[i].name.indexOf('ret')!= -1 ¦¦ document.forms[0].elements[i].name.indexOf('Ret')!= -1){
fieldtoclear = document.forms[0].elements[i];
clearselect (fieldtoclear);
}
}
clearselect is a little function to do just that.
the only problem is, (this is just for NN btw) it seems to clear the field that fires off the script, even tho it certainly does NOT have ret in its name at all.
i even tried a
if(fieldtoclear.name!= 'selJourney'){
//then do the clearing..
}
to avoid this field (selJourney the one i want to leave alone). sadly it still does it.. am i missing something obvious as usual..
many thanks in advance..
nat