I am trying to put a variable into a dom string. I have various fields as such:
<input type="text" name="itemdesc1" />
<input type="text" name="itemdesc2" />
I want to loop through these to see if they are populated before submit. The only problem I have is that I cannot run them through a loop, because I need to put a variable into the DOM string. The variable is "i".
if (document.insertinv.itemdesc(variable_here).value == ''){
// Code
}
Is there any specific way to do this? Preferably without adding id's to the fields.
Thanks!