I am making use of trim() like so:
if($(\'#group_field\').val().trim()!=\'\'){
Where group_field is an input element of type t
group_field
As far as I know, Javascript String does not have the method trim. If you want to use function trim, then use