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

[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.
#2

[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?
#3

[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.
#4

[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.
#5

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

[removed][removed]
#6

[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
#7

[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 .
#8

[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);
          
      });
#9

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

[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.....




Theme © iAndrew 2016 - Forum software by © MyBB