Hello star,
"Avoiding loops is a bad idea if there are many operations of the same type."
Well that is an idea that needs to be examined.
One might say "operations repeated on items of the same type" which is not quite the same thing.
And the usefulness of a loop might depend on how easy it is to refer to the items. For example, the items in the form elements collection. Even so you might need to watch out for those elements that are fields with values between 1 and 5, in this case elements[4] through elements[11].
Then too, what about the impact of changing requirements? Suppose we add more fields, maybe some hidden fields, at the top of the form? Have to adjust those loop parameters if you used a loop; but the code which refers to the fields by name is OK.
Not to mention readability. Who knows what form[0].element[5] is, but myRatingForm.cat2, no problem.
And is 5 blocks of if{} code "many"? Maybe 50 is "many". Maybe 5000. The few extra bytes in this situation are not going to exhaust memory or clog a dial-up connection.
"Papa don't preach."