I'm working on this but it seems if I do double space it still counts as a word

   function validateReview(reviewContent, error){
        var reviewContent = document.getElementById("reviewContent").value,
        error = document.getElementById("reviewtxtError");
        text = reviewContent.split(" ").length;

   if(text == null || text==""){      
    document.getElementById("reviewContent").style.borderColor = "red";   
    return error.innerHTML = "Review is required";
    return false;
   }
    else if(text < 50){
    document.getElementById("reviewContent").style.borderColor = "red";       
    return error.innerHTML = "Review must be at least fifty words";
    return false;
   }
   else{
       document.getElementById("reviewContent").style.removeProperty('border'); 
       return error.innerHTML = "";
       return true;
   }
}

    Because with a double space there is a zero-length substring between the two spaces that counts as a word.
    Use a regular expression instead: [font=monospace]/\s+/[/font] (using [font=monospace]\s[/font] instead of [font=monospace] [/font] so that line breaks and the like count as "spaces").

      Oh like?

      function validateReview(reviewContent, error){
              var reviewContent = document.getElementById("reviewContent").value,
              error = document.getElementById("reviewtxtError");
              text = reviewContent.split(/\s+/).length;
      
         if(text == null || text==""){      
          document.getElementById("reviewContent").style.borderColor = "red";   
          return error.innerHTML = "Review is required";
          return false;
         }
          else if(text < 5){
          document.getElementById("reviewContent").style.borderColor = "red";       
          return error.innerHTML = "Review must be at least fifty words";
          return false;
         }
         else{
             document.getElementById("reviewContent").style.removeProperty('border'); 
             return error.innerHTML = "";
             return true;
         }
      }
      

        ...ish.

               if(text == null || text==""){      

        [font=monospace]text[/font] is an integer; you should really say what you mean and check if [font=monospace]text === 0[/font].

        More importantly, an empty [font=monospace]reviewContent[/font] string would produce an array with a length of 1, and one that consists solely of a bunch of spaces would produce an array of length 2.
        [font=monospace]reviewContent[/font] should be trimmed first, and checked to see if it is an empty string before continuing with the word count checks.

        var reviewContent = document.getElementById("reviewContent").value.trim();
        if(reviewContent === "") { /* empty review */}
        else
        {
           wordcount = reviewContent.split(/\s+/).length;
        //etc......
        }
        

        Another thing I've noticed:

                return error.innerHTML = "Review must be at least fifty words";
                return false;
        

        The first [font=monospace]return[/font] probably shouldn't be there (and likewise in the other blocks). You'll be having the function returning error message, and not the true/false you're trying to return on the next line (which will never be reached).

          
           function validateReview(reviewContent, error){
                  var reviewContent = document.getElementById("reviewContent").value.trim(),
                  error = document.getElementById("reviewtxtError");
                  text = reviewContent.split(/\b\S+\b/g).length;   
          if(text === 0){
          document.getElementById("reviewContent").style.borderColor = "red";
          error.innerHTML = "Review is required"; return false; } else if(text < 5){ document.getElementById("reviewContent").style.borderColor = "red";
          error.innerHTML = "Review must be at least fifty words"; return false; } else{ document.getElementById("reviewContent").style.removeProperty('border'); error.innerHTML = ""; return true; } }

          I think, but I can make D.R.Y it up more

            Write a Reply...