Posts: 850
Name: Matt Pealing
Location: England, north west
|
Im using the code
Code:
if (form = document.getElementsByTagName ('form'));
To check if a page contains any form elements.
The code below it uses
Code:
formSelect = form[0].id;
To assign the first form to a variable. But I keep getting the 'has no properties' error if there are no form elements on the page. Does anyone know why it is even getting to this part of the code when there are no elements on the page? surely it should just skip the whole bock of code below the if statement?
|