Is there a better command than this to check if a form is exists and if so submit it? Right now I’m using:
if(document.forms[0])document.forms[0].submit()
Which works, however if form[0] does not exist it throws an exception. I’m trying to keep this dynamic in the sense I don’t know what the form ID or name is.
To avoid the exception you could do: