moved the javascript code inside page_form.js