CodeIgniter Forums
jquery post - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: jquery post (/showthread.php?tid=34748)

Pages: 1 2


jquery post - El Forum - 10-08-2010

[eluser]meera[/eluser]
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:
$(document).ready(function()
{
$("#edit").click(function()
{
alert("ok");

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

});

});
});
And i used the following controller code:
$pname=$this->input->Post('gname');
$disc=$this->input->Post('disc');
$desc=$this->input->Post('desc');
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.


jquery post - El Forum - 10-08-2010

[eluser]SPeed_FANat1c[/eluser]
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?


jquery post - El Forum - 10-08-2010

[eluser]jmadsen[/eluser]
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.


jquery post - El Forum - 10-08-2010

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


jquery post - El Forum - 10-08-2010

[eluser]kirtan.n[/eluser]
use gogole's CDN

[removed][removed]


jquery post - El Forum - 10-08-2010

[eluser]pickupman[/eluser]
[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:
Code:
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js



jquery post - El Forum - 10-08-2010

[eluser]meera[/eluser]
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 .


jquery post - El Forum - 10-08-2010

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



jquery post - El Forum - 10-08-2010

[eluser]meera[/eluser]
Ya,like this only,but i use this i am not getting any responce.


jquery post - El Forum - 10-08-2010

[eluser]meera[/eluser]
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.....