Empty field ( check form )

is there some function to check a form on empty fields or check the
City is the first capital letter if not he will change this letter and
put to database ?

thanks