Welcome Guest, Not a member yet? Register   Sign In
How to change the text on a button progamatically?
#9

Code:
cb.parent('tr').find('.btn-danger').text(data);

Can become:
Code:
$('#myCamp').text(data);

The difficulty is in the buttons you create with the crud->add_action method. These buttons must have a css class to enable jQuery to listen to the click event. Try to give the buttons a css class "make-active".
Then, see if jQuery can detect the event:

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

Try if you get that working.
Reply


Messages In This Thread
RE: How to change the text on a button progamatically? - by Wouter60 - 01-10-2018, 12:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB