js partly working

Needs better string manipulation to change all the fields that need it.