Welcome Guest, Not a member yet? Register   Sign In
[solved] $_POST: jQuery AjaxForm plugin: The input class: What I am doing wrong?
#1

[eluser]mhulse[/eluser]
Hi,

I am using jquery ajaxform plugin to post a form to a controller/view.

For some reason, when I run:

Code:
var_dump($this->input->post('base'));

I get this:

Code:
bool(false)

But when I run this code:

Code:
var_dump($_POST)

I get this:

Code:
array(1) {
  ["formfm"]=>

  array(1) {
    ["formfm"]=>
    array(1) {
      [0]=>
      array(3) {
        ["base"]=>
        string(5) "eeeee"
        ["steps"]=>
        string(0) ""
        ["submit"]=>
        string(2) "Go"
      }
    }
  }
}

As you can see, the posted "base" key is there.

What do you think I am doing wrong? Is this the expected behavior, of the input class, when posting a form via ajax?

I don't mind working with $POST directly, but I would like to use CI's built-in stuff for the sake of security and such.

Any tips and/or suggestions?

Thanks!
Micky
#2

[eluser]InsiteFX[/eluser]
Post the code to your controller and view.

InsiteFX
#3

[eluser]mhulse[/eluser]
Hi InsiteFX! Thanks for the help, I appreciate it. Smile

Agh, in the process of writing a reply to you, I discovered the problem! On top of the jQuery ajax form, I was chaining another form plugin that was modifying the $_POST array. When I removed that plugin the CI code worked without any probs.

Sorry to bug ya'll with this.

Cheers,
Micky




Theme © iAndrew 2016 - Forum software by © MyBB