First, why are you validating with Javascript? If you aren't posting back to the server, then $rate isn't going to change. But maybe I don't get what you're trying to do.
More importantly, if $rate is a number, then:
(" <?php echo $rate; ?>; ")
is going to be compared as a string. For example, if $rate equals .75, then the Javascript statement will evaluate to:
if (document.form2.discount.value > (" .75; "))
I can't see how that statement would give you any useful results. If you eliminate the quotes and parens, you might have something:
if (document.form2.discount.value > <?php echo $rate; ?>)
would evaluate to:
if (document.form2.discount.value > .75)