avoid $.trim() exception

With a combination of latest browser and jquery libraries, values coming from the form may already be of type "number" instead of "string" and so $.trim() will throw an exception.  This casts any values as a String, in case they aren't already, so that the $.trim() call will succeed.