I have the following code and wanted to make an improvement on it.
if(id == 1)
if(myWindow1){
myWindow1.form_1.submit();
myWindow1 = "";
}
if(id == 2)
if(myWindow2){
myWindow2.form_2.submit();
myWindow2 = "";
}
if(id == 3)
if(myWindow3){
myWindow3.form_3.submit();
myWindow3 = "";
}
if(id == 4)
if(myWindow4){
myWindow4.form_4.submit();
myWindow4 = "";
}
if(id == 5)
if(myWindow5){
myWindow5.form_5.submit();
myWindow5 = "";
}
where myWindow ... is a popup that may have been created. If I know the amount of popup that was created (and I know) I could do more or less this way (like I do in PHP)
while($contador < $qtdAlgo){
$nomeVariavel = ${"myWindow". $contador}
$contador++;
}
So I would get all the variables that already exist and I could do something with them ... There is a way for me to keep my code on top {myWindow1.form_1.submit ()}?
Obs. form_1 would also have to be concatenated.
or more or less so
myWindow {counter} .form_ {counter} .submit ();