added alert handling and converted the backend forms to pure JS