Hi,
1. On click event of labels call a
java script function
2. In that java script function, create an XMLHttpRequest object
3. Create a post
string that needs to send to servlet calss. In your case "user name"
4. By using XMLHttpRequest object's 'open','setRequestHeader','send' methods send the request to the servlet
5. Do your business logic in servlet and send the output to java script by write/print/JSON techniques.(in your case 'true/false' or exists/available)
6. In java script check for readyState(ie readyState ==4) then use XMLHttpRequest object.responseText to get the result that sent from servlet.
Regards,
Anbarasu