FYI: The discussion group software put a premature line break at the
end of line 4 of the code.

On May 14, 7:35 pm, infoaddicted <jack.lapla...@gmail.com> wrote:
> How about this?  It's only called when the user leaves the field.  The
> replace uses a regular expression, the part between the forward
> slashes.  The \s means "space", the + means one or more of the
> preceding, and the $ means match only at the end of the string.
>
> $(document).ready(function(){
>             $("#couponCode").blur(function (e){
>                 $("#couponCode").val($(this).val().toUpperCase());
>                 $("#couponCode").val($(this).val().replace(/\s+
> $/,''));
>             });
>         });

Reply via email to