PDA

View Full Version : javascript gurus - please help


N!ck
02-17-2003, 08:45 PM
<script language="javascript">
<!--
function validate(theform) {
if (theform.linktitle.value=="" || theform.linkurl.value=="" || theform.linkdesc.value=="") {
alert("Please complete the title, address, and description fields.");
return false; }
elseif (theform.linkdesc.length>80) {
alert("The link description is not to exceed 80 characters.");
return false; }
else { return true; }
}
//-->
</script>


That returns true no matter what (yes, I made sure and put onSubmit="return validate(this)" in the form tag). Any ideas?

N!ck
02-18-2003, 02:07 AM
if anyone's interested, the problem is here:


elseif (theform.linkdesc.length>80) {


it should be:


else if (theform.linkdesc.value.length > 80) {