Welcome Guest, Not a member yet? Register   Sign In
jquery post

Hi, i am using jquery to post the text box vales .
I want to post the text box values to display on another text box in submitted page.
i have used the following jquery function:

$.post("/product/editnew", {id:$("#id1").val(), gname: $("#gname").val(), disc: $("#disc").val() ,desc: $("#desc").val()
}, function (data) {


And i used the following controller code:
and passed these values to the view i want to display.

But i cant get the result ,can any one tell me solution .may i would got wrong becouse i am very new to CI.Thank u in advance.

are you getting some php, javascipt errros?
or maybe you try to use full url in $.post method, like http://www.yoursite.com/product/editnew maybe there is some problem?

First, try "post" not "Post" - php/codeigniter is usually case sensative

Second, is your jquery functioning? Is the alert popping up? (btw, you should try firebug for Firefox, or similar, to get more info).

Third, Can you echo $pname, etc?

Those should get you started toward debugging. Your jquery looks alright to me, but of course I don't know your html and I'm staring at it with tired eyes.

Hi, i have Jquery in ZIP format.how could i do Unzip it.how to install it.please suggest me more in this concern.

use gogole's CDN


[quote author="zeeq" date="1286568709"]Hi, i have Jquery in ZIP format.how could i do Unzip it.how to install it.please suggest me more in this concern.[/quote]

That's kind of scary to hear a developer mention. Just link to in your script tag:

I am getting the values,but i want use those values as arguments in my url link ,can i use this or i have to use any other method .

Is this what you are trying to do?
var edit_id = $('#id1').val();
$.post('/product/editnew/' + edit_id, {id:edit_id, gname: $('#gname').val(), disc: $('#disc').val() ,desc: $('#desc').val()
          }, function (data) {

Ya,like this only,but i use this i am not getting any responce.

Exactly my need is,i am creating a form in that i displayed datas from database.
now i want to edit those values and update on database so i have to pass the id to controller and fetch the datas in that id and edit them and update.
what i have to use there.....

Theme © iAndrew 2016 - Forum software by © MyBB