Fixed Javascript field methods not working when viewing HTML form