How to send set of data for Ajax call from jquery with php at the serverside?
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 h开发者_开发知识库ave 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.
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());
精彩评论