How to validate links before moving to different location
You can achieve this using a client side validation. Like below,


Add an ID attribute to the external link

$form['new_user'] = array(
  '#type' =&gt; 'item',
  '#markup' =&gt; l('Add New User','http://www.google.com', array('attributes' =&gt; array('id' =&gt; 'external-link'))),            
);

Add a JavaScript code to validate and preventi the click.

jQuery(document).ready(function() {
  jQuery('#external-link').click(function(event) {
    // Perform your validation. If the validation fails prevent events default behavior.
    validated = false;
    if (!validated) {
      event.preventDefault(); // You can also use return false instead of prevent default.
    }
  });
});



Hope this helps :)