Executing jQuery code during form submission
Try this 

   $form['actions']['property_endlease'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; t('End'),
            '#access' =&gt; TRUE,
            '#weight' =&gt; 15,
            '#attributes' =&gt; array("onclick" =&gt; "javascript:test();"),

        );


and create a custom js 

function test()  {
//your code 
}


Hope it will work