move javascript to the bottom of page
update id of hidden field