title: Automatic scrolling when clicking my submit button
body: <p>So on my custom module that I've created, there's a submit button (form defined in php) but it already acquires an action where it calls a callback function to trigger the display of some information regarding a certain barcode right below it. </p>
  
  <p>All I want to do is add some code that will allow my submit button to also trigger an automatic scroll down without a link/anchor (because I want the SUBMIT BUTTON to acquire that action, not another link) so that the user doesn't have to scroll down to view the information.</p>
  
  <p>The reason I'm avoiding the link/anchor option is because I just dont want to have a separate entity that needs to be clicked in order to scroll down. I want the scroll to happen right when i click my submit button. Unless a link can be combined with a button? Thanks!</p>
  
  <p>My PHP submit button form: </p>
  
  <pre><code>//submit button that uses ajax (to display whats in callback)
  $form['submit_button'] = array(
              '#type'=&gt; 'submit',
              '#value'=&gt; t('Submit'),
              '#ajax' =&gt; array( //no need to refresh the page bc ajax
                      'callback' =&gt; '_ibbr_inv_after_callback', //callback
              ),
              '#suffix' =&gt; "&lt;div id='after_div'&gt;&lt;br&gt;&lt;/div&gt;
                        &lt;div id='after_status'&gt;&lt;/div&gt;",
      );
      return $form;
  </code></pre>
  
  <p>My PHP callback function:</p>
  
  <pre><code>//function for submit button callback
  function _ibbr_inv_after_callback($form, $form_state) {
      $selector = '#after_div';
      $commands = array();
  
      $query = new EntityFieldQuery();
      $entities = $query-&gt;entityCondition('entity_type', 'node')
      -&gt;propertyCondition('type', 'eq')
      -&gt;propertyCondition('title', $form_state['input']['barcode'])
      -&gt;propertyCondition('status', 1)
      -&gt;range(0,1)
      -&gt;execute();
  
      //If this barcode is found in database
      if (!empty($entities['node'])) {
              $node = node_load(array_shift(array_keys($entities['node'])));
  
              //Load fields from returned equipment item
              $room = taxonomy_term_load($node-&gt;field_eq_room['und'][0]['tid']);
              $desc = $node-&gt;field_eq_description['und'][0]['value'];
              $manu =  $node-&gt;field_eq_mfr['und'][0]['value'];
              $model = $node-&gt;field_eq_modelno['und'][0]['value'];
              $serial = $node-&gt;field_eq_serial['und'][0]['value'];
              //displaying all the components of the specific barcode
              $info = "&lt;div id='after_div'&gt;&lt;b&gt;Title&lt;/b&gt;: $node-&gt;title&lt;br&gt;
                              &lt;b&gt;Description&lt;/b&gt;: $desc&lt;br&gt;
                              &lt;b&gt;Manufacturer&lt;/b&gt;: $manu&lt;br&gt;
                              &lt;b&gt;Room&lt;/b&gt;: $room-&gt;name&lt;br&gt;
                              &lt;b&gt;Model Number:&lt;/b&gt; $model&lt;br&gt;
                              &lt;b&gt;Serial Number:&lt;/b&gt; $serial&lt;br&gt;&lt;/div&gt;";
              //Displaying the Confirm and Flag buttons
              $commands[] = ajax_command_replace($selector,  $info);
              $commands[] = ajax_command_replace("#after_status", "&lt;div id='after_status'&gt; &lt;button id = 'confirm' type = 'submit' name = 'Confirm' value = 'Confirm'&gt; Confirm&lt;/button&gt;&lt;button id = 'Flag' type = 'submit' name = 'flag' value = 'flag'&gt;Flag &lt;/button&gt; &lt;/div&gt;");
              //$commands[] = ajax_command_invoke("#after_div", 'animate', array("{scrollTop: top}",1000));
      //If this barcode is not found in the database
      }else {
              //Displaying the Add button and "Item not found" ONLY IF this entity is empty (meaning barcode was not found in database)
              $commands[] = ajax_command_replace($selector,  "&lt;div id = 'after_div'&gt;Item not found.&lt;/div&gt;");
              $commands[] = ajax_command_replace("#after_status", "&lt;div id='after_status'&gt;&lt;button id = 'add' type = 'submit' name = 'Add' value = 'Add'&gt;Add new item&lt;/button&gt;&lt;/div&gt;");
  
      }
      return array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);
  }//end _ibbr_inv_after_callback
  </code></pre>