thank you gentlemen!!! The <= is no < and that worked perfectly.

I'm redesigning to use the while loop, thanks for that as well. Much obliged.

J


On Wed, 16 Feb 2005 14:55:19 -0400, Micha Schopman
<[EMAIL PROTECTED]> wrote:
> I did some refactoring for you :) while loops in javascript are quicker than 
> for loops.
> 
> function Validator() {
> var myform = document.getElementById('SuggestionForm');
> var errMsg = ''
> var checkboxcounter = 0;
> 
> if (myform.SuggestionText.value.length <= 0){
>   errMsg += '- Please explain your suggestion.\n\r'
> }
> 
> if (myform.SuggestTitle.value.value.length <= 0){
>   errMsg += '- Your suggestion needs a title.\n\r'
> }
> 
> var i=myform.Impact.length;while(i--){
>   if(myform.Impact[i].checked){
>     checkboxcounter++;
>   }
> }
> 
> if (errMsg.length > 0) {
>   alert(errMsg)
> }else{
>  myform.submit()
> }
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195078
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to