Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: dynamic check boxes validation

$
0
0

the very last statement in your validateForm function should be "return true;"

 

Also you have a mistake in the code. You've got:

 

if (document.getElementById ("comments").value.length == 0)

    alert ("Please enter a search field");

    return false;

 

 

 

}

 

However you don't have an opening { on that  IF statement.  And the closing } we can see is for the function itself, not that IF.

 

So it's really doing it like this:

 

if (document.getElementById ("comments").value.length == 0) {

    alert ("Please enter a search field");

}

 

return false;  

}

 

i.e. it always returns false for your validate function.  Change that last bit of the code like so:

 

if (document.getElementById ("comments").value.length == 0) {

    alert ("Please enter a search field");

    return false;

 

return true; 

}


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>