First of all, I can understand why you want to calculate the number in Javascript... but you don't have to pass that value up to the server. PHP is perfectly able to count the number of words for itself. (And as a security precaution, you should never have PHP trust the results that JS came up with anyway).
But second, if there was some reason why you needed to pass JS's numWords, you have to have the giveEstimate() function actually run so that numWords actually gets a value. For example, in this script, if I just press the Checkout button without pressing the Estimate button, then giveEstimate() will not have run and numWords still has it's "0" value (which it got from line 1).
Third, I would remove the "var" from line 7. You already established that numWords was a variable in line 1. There's no need to do it again on line 7 and it could actually be harmful because it can confuse the scope of numWords. Declaring it as a variable on line 1 is correct for this project because it gives it scope inside every function such as giveEstimate and gotoCheckout. But when you RE-declare it as a variable inside the giveEstimate function, you could be reducing its scope to just be available inside that function.
But most importantly, you really need to ask yourself why you're passing the word count up to PHP. PHP can figure it out by itself.