how to check availability of more than one field using ajax on keyup?

i don't want to write the ajax call for two times.. more i want to display the message at the front of each field?

any idea?