Changed the validation in editpa andd publishpa.js files