UPDATE:<\/strong>
\nHere’s what the field might look like for Drupal 7:<\/p>\n$form['reset'] = array(\r\n '#type' => 'markup',\r\n '#markup' => '<input class=\"form-submit\" type=\"reset\" value=\"Reset\">',\r\n);<\/pre>\n","protected":false},"excerpt":{"rendered":"Using\u00a0hook_form_alter\u00a0or hook_form_FORM_ID_alter\u00a0one can easily add a “Reset” button to a Drupal form. In this example we’re actually trying to reset anything the user typed after the form loaded. This will not remove\u00a0the default values. Here’s a simple example (Drupal 6) \/** * Implementation of hook_form_alter(). *\/ function mymodule_form_alter(&$form, &$form_state, $form_id) { switch ($form_id) { case ‘myform’: $form[‘buttons’][‘reset_button’] = array( ‘#type’ => ‘markup’, ‘#value’ => ‘<input class=”form-button” type=”reset” value=”Reset”>’, ‘#weight’ => 2000, ); break; } } It may not be appropriate for you to put your new reset element into the\u00a0buttons\u00a0array. Use dpm() (part of the Devel module) to show what $form looks like. If you don’t understand this, and the code above isn’t working for you, you may try\u00a0$form[‘reset_button’] = array…. Adjust the value of #weight to move the button around the form.\u00a0dpm($form)\u00a0will show you weights (if any) of existing elements so you can make educated decisions about the weight of your new field. One last note about the\u00a0‘#type’ => ‘markup’\u00a0line: this is not a requirement, but I like to include it for clarity. UPDATE: Here’s what the field might look like for Drupal 7: $form[‘reset’] = array( ‘#type’ => ‘markup’, ‘#markup’ => ‘<input class=”form-submit” type=”reset” value=”Reset”>’, );<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[79],"tags":[84,85,83,22,20],"_links":{"self":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/171"}],"collection":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":4,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":1676,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/171\/revisions\/1676"}],"wp:attachment":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}