Small JS snippet for validation and smiles.