is the username one of the fields in the form?
if so you can get the username from the form. but you are relying on the person filling in the form to enter the correct username.
if it is not a part of the form, then there is not a way to get the username if they are not logged in.