A couple of notes here. This code is certainly not optimized and certainly not prettied up. A lot of the functions need to be merged into cleaner functions. The memory usage could probably optimized a little better. There are a couple of other things to play with as well. This is basically a way to help you learn how to implement different features using Salesforce.com in HTML5 with JQuery mobile, such as querying profiles and dynamically populating a form picklist and displaying lists of users on the screen and activating/deactivating users, etc. Take what you will from this, but it is a fully functional mobile app for you to hack and place into PhoneGap if you would like.
This code goes into the usermanager.resource static resource (after the break).
Read more »