开发者

Limiting validation to the create page not the edit page

开发者 https://www.devze.com 2023-02-12 02:41 出处:网络
What is the best way to limit your custom validation check to the add page an开发者_C百科d not the edit page?You could use the arg() function to check that you\'re on the /node/add/... page. Try chang

What is the best way to limit your custom validation check to the add page an开发者_C百科d not the edit page?


You could use the arg() function to check that you're on the /node/add/... page. Try changing the first line inside your hook_form_alter implementation to read...

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

精彩评论

暂无评论...
验证码 换一张
取 消