Hi I'm a VB bloke really, but need to use javascript from time to time.
I have a form an validate it as follows:
~~~~~~~~~~
function Validate()
{
if (QuotePart2.SubsidenceCover.Value=="Yes" &&
QuotePart2.Buildings.Value=="")
{
alert('You have selected buildings cover, but not entered the
value of the buildings, please do so.');
return false;
}
else if (document.QuotePart2.Agreed.checked == false)
{
alert('You must tick the box to show that you have checked the
sums insured, and they are correct.');
return false;
}
return true;
}
~~~~~~~~~~
My problem is that ensuring the checkbox is checked works just fine,
but I can't get the first bit to work, SubsidenceCover is a drop down,
if "Yes" is selected but there is no value in Buidings I need to stop
there, can anyone spot an error?
Many thanks
Jon