Add js validation to edit pages