⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

getting a click event from an add-action() call



richb201
  • profile picture
  • Member

Posted 11 January 2018 - 18:20 PM

//this is in the controller

$crud->add_action('Make Active', '', 'Configure/company_update','make-active');

 

//this is in the view

<script>
$(document).ready(function(){
$('.make-active').click(function(e){
e.preventDefault();
alert('You clicked on a button with the css class make-active.');
});
});
</script>

 

//this is in the controllelr

company_update()

{

 

}

 

I have added an action button. When a user clicks it, company_update() runs fine. But I am trying to catch the onclick event so I can update a button's text on my view's display. I never seem to get the click event. What am I doing wrong?