mfayaz,
Your script/code will ask for the signature but not do anything with it.
If you want this to be one ONE page, I would do a google search on Ajax and PHP, and have TWO text fields, one for signature, one for username.
If you use the prompt with the onclick, if someone were to 'tab' into that field, it won't bring up the prompt which is not what you want.
if you have the two text boxes, you can set the signature item to onblur (when they LEAVE the textbox) so that no matter if they tab or click they will get it.
also, what will you do if they just type in a username? You will want your script to do some form of verification for that, of course, this depends on what you are doing with this information.
I would use Ajax to ask for the signature, and populate / ADD a new hidden text field for the POST/GET data, then just change the contents of a DIV/SPAN to display the username from the signature.
This will help from allowing anyone to just type in whatever they want in the user field, as well as if they don't click on the user box.
Of course, Ajax can also be used to prompt onclick as you have it, and check the data and return the username you want.
Here are some Ajax/PHP articles:
http://www.ajaxf1.com/tutorial/ajax-php.html
http://www.w3schools.com/PHP/php_ajax_database.asp
I would recommend giving it a try and if you have problems, come back and we would be glad to help.