Need help - Listview + form + autofill j

Need help - Listview + form + autofill j

So I'm trying to develop a simple database setup that accesses a mysql database and populates a listview with the contents.  That was no problem so next I added a click feature which brings up a form when you click on an item and puts that items mysql id number in the url after the hash.  This is where I'm having worlds of problems.  How can I pass that hash value to the next page so I can call a mysql query and auto fill the input fields with data pulled from mysql.  Then when I click the "submit" button it updates the database with the contents of the input fields.

I found a lot of posts online from people who said you can access the value after the # in the url using cookies or javascript and whatever else but none of them worked for me.  I don't know if the cookie was set properly and the form syntax was wrong or what. 

This seems like a common use for web apps but I searched for hours and couldn't find any examples that filled in the form with the data based on the listview items id.

Maybe I don't know what to search or its impossible.  Does this sound doable and does anyone have an example or code that can achieve this?