Welcome Guest, Not a member yet? Register   Sign In
ajax query from multiple <li> elements
#1

[eluser]Unknown[/eluser]
Hi,
I am new to codeigniter. Appreciate your help.

I have a list of <li> elements in my view as follows (in pseudocode):

<ul>
<li>&lt;form id="1 action="method"&gt;button....&lt;/form&gt;&lt;li>
<li>&lt;form id="2 action="method"&gt;button....&lt;/form&gt;&lt;li>
<li>&lt;form id="3 action="method"&gt;button....&lt;/form&gt;&lt;li>
...
</ul>

I want to call the same method (Ajax) in my controller and pass a couple of post variables.

The method would just return success/failiure (standard Jquery/Ajax) stuff back to the view.

Can someone please post some code. I need the following:

A. js file that handles
a. submit events coming from the form submit in the view
b. knows how to parse a list of unique form ids.
c. posts a Get/Post request to a controller
d. updates a div tag in the view

B. View file with some basic code

C. Controller file with some basic code

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB