Javascript Form - if input enabled then...

Soldato
Joined
30 Nov 2005
Posts
3,084
Location
London
Hey all,

Got a really complicated form with javascript validation that I'm having to bolt on some more validation.

Essentially, a form input field is disabled until a checkbox is ticked then it becomes enabled. This all works fine.

Now I need to check ONCE then input filed is enabled it is NOT left blank or with just whitespace entered.

I've tried:

Code:
function checkall(contactform)
{
if (document.contactform.Telenumber.disabled = false) 
  { 
  if (document.contactform.Telenumber.value == "")
		{
		alert("You must enter a Tele number.");
		return (false);
		}
  }
}

Any ideas what's wrong here?
 
Back
Top Bottom