Tooroop
Tooroop

Reputation: 1884

Codeigniter submit form written in plain HTML

I'm playing for about 2 days now and can't make this out. I'm working in codeigniter 2.1.0. and I want to submit a form that is written in HTML. I don't want to use the CI form helper.

The reason is because I'm dynamically with JavaScript adding things in the form. When a user clicks an item then it's added to the form. Now when the user clicks the submit button all the items I added should be sent in a POST request, but my POST is totally empty.

Now I noticed that the POST only gets sent when I use form_input() from the CI form_helper. Is it possible to just submit a normal plain HTML form without using the form helper?

Upvotes: 2

Views: 774

Answers (1)

hakre
hakre

Reputation: 198217

Is it possible to just submit a normal plain HTML form without using the form helper?

Yes. The actual submit is totally independent to CI, just ensure you use the correct action URI of the form so that the correct controller action is called by the form submit post (I assume your form method is post) request.

You do not need to use the CI form_helper for the submit button. If you mock a form with these you will see that those just generate plain HTML and do nothing magically.

Upvotes: 3

Related Questions