drupal - Node edit form: edit or new state? -
what's best way of figuring out if node form in create new node state or edit existing node state?
is there in $form
array or have kludge arg()
?
are asking node edit form? if so, can either following:
if (empty($form['nid']['#value'])) { // in add form } else { // in edit form }
or...
if (arg(1) == "add") { // in add form... } else { // in edit form... }
Comments
Post a Comment