Text Box Not Defined?

I posted this in a JS forum, but to no responses, I put out a plea to the JSP Gods:

==========================================

I have a javascript function to check the validity of the contents of a couple-o-textboxes.

BUT --> I am using a JSP that may or may not actually have displayed said textboxes.

Is there a way in Javascript to check if the textbox is defined?

I get an telephone_contact not defined error and wish to check for the definition of telephone_contact and patient_contact before checking validity

[571 byte] By [wmacey] at [2007-9-26 1:51:39]
# 1

Yeah, you can test for the existance of the textbox by trying this:

if (null != document.yourFormName.telephone_contact)

{

// it exists

}

This works *sometimes* :)

~~~~~

I'm convinced the future of Quantum Computing lies in JavaScript

Enygma42 at 2007-6-29 3:00:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...