Data type validation helper for use with javascript.