php - Limiting validation to the create page not the edit page -


what best way limit custom validation check add page , not edit page?

you use arg() function check you're on /node/add/... page. try changing first line inside hook_form_alter implementation read...

if($form_id === 'external_favourite_node_form' && arg(1) == 'add') { 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -