If you have given same text name for both of your Id and Name properties you can give like document.getElementByName('frmMain')[index]
other wise object required error will come.And if you have only one table in your page you can use document.getElementBytag('table')[index]
.
EDIT:
You can replace the index according to your form, if its first form place 0 for index.