View Full Version : How do I Determine Whether I am In a Form or Not Using DOM?

12-30-2005, 06:40 PM
I am writing a generic javascript function. It can be used at the Form onSubmit or anywhere that is not inside a form. I need a way to determine whether this function is running inside a form or not. How do I do that?

I can pass a form name as parameter into the function then check the arguements.length. But I want a cleaner way. Maybe I can use "this" object to do it?

Many thanks.