views:

61

answers:

1

I basically have to do a update of a record. I have a set of controls like textbox, list box, radio button etc. Then i have a button on click of which i need to carry all the updated data into mysql database with a ajax request without page refresh.

I am using the php with codeigniter as my serverside code. On client side i am able to send the ajax request like

$(document).ready(function(){

 $('#users_menu').click(
function(){     
                 $('#tempdiv').load('http://localhost//web1/index.php/c1',null);
          }

            );

                        });

In the above code the request is placed to a server side php page where i am not able to read the values of the control values (values of textbox, listbox etc). Now this means i should be sending the list with the request. But i am not aware of how to send this request.

Please help me with some details of how to send the list of values or is it possible to read the vaules some how in the serverside php code. For your information i am using codeigniter with my php. Any kind of help is appreciated.

Thanks and Regards VinodT.

+1  A: 

You need to use jQuery .post() function and specify the data to send, see here jQuery.post

You will end up needing to do something similiar to this.

$.post("http://localhost//web1/index.php/c1", $("#testform").serialize());
Dyllon
.serializeArray() helps even more. Reffer to the below link "http://api.jquery.com/serializeArray/" Also refer to the below link for complete help with php, codeigniter, ajax cal put together."http://www.mrforbes.com/thoughts/2009/01/28/a-quick-code-igniter-and-jquery-ajax-tutorial/"
Vinodtiru