JavaScript Send js value to php controller by ajax send value controller to view,send value from controller to

Since the php script is conditioned by a second POST variable [if(isset($_POST['activation']))], you should post that as well.

function handleButton(obj) {
    var javascriptVariable = obj.id;
//  alert (javascriptVariable);
    $.ajax({
          type: "POST",
          url: "<?php echo base_url(); ?>index.php/admin/active_users",
          dataType: 'text',
          data: 'myname='+javascriptVariable+'&activation=1',// <-- RIGHT HERE
          success: function (data){
              alert(data);
            }

    });
}

SIDE NOTE: you could also echo instead of dump the variable:

if(isset($_POST['activation']))
{
    echo $this->input->post('myname');
}
Answer:1

How do I use enums in ES2015? I tried the following but I'm getting errors: Created a file for my enums i.e. errorTypes.js export const Types = { MISSING_DATA: 0, INVALID_DATA: 1 } I then ...

How do I use enums in ES2015? I tried the following but I'm getting errors: Created a file for my enums i.e. errorTypes.js export const Types = { MISSING_DATA: 0, INVALID_DATA: 1 } I then ...

While attempting to use React.js and maybe or most likely I am doing something wrong? But when I run React.Render() nothing visible renders, however. Viewing the DOM through Chromes console I can see ...

While attempting to use React.js and maybe or most likely I am doing something wrong? But when I run React.Render() nothing visible renders, however. Viewing the DOM through Chromes console I can see ...

given the following: constructor () { super(); this.state = { inputs : [ { type: 'email', placeholder: 'Email Address' } ] }; } render () { return { &...

given the following: constructor () { super(); this.state = { inputs : [ { type: 'email', placeholder: 'Email Address' } ] }; } render () { return { &...

  1. loop over form controls angular
  2. loop over formarray
  3. loop over form data
  4. loop over formgroup controls
  5. loop over form javascript
  6. loop through form controls angular
  7. loop through form elements jquery
  8. loop through form elements javascript
  9. loop through form elements
  10. loop through formarray
  11. loop through form inputs jquery
  12. loop through form data
  13. angular loop through formarray
  14. loop through form controls vba
  15. loop through form fields django
  16. loop through form controls
  17. loop through form inputs
  18. loop through form group
  19. loop through form fields javascript
  20. loop through form fields jquery

I have the following javascript function that prevents form submission if all required fields are not complete and is part of a form I am creating using Google Apps Scripts. Note that the #...

I have the following javascript function that prevents form submission if all required fields are not complete and is part of a form I am creating using Google Apps Scripts. Note that the #...