Reformatted the code, html and javasctipt

Added the function to update the record