Welcome Guest, Not a member yet? Register   Sign In
CI and Jquery Loop wont work...
#11

[eluser]1mr3yn[/eluser]
so how can i pass this " $('#myinput').val($(this).text()); " into a PHP variable??
#12

[eluser]Thorpe Obazee[/eluser]
oh... I misunderstood what you meant.
[quote author="r3yn" date="1245329902"]I mean I need to pass this variable '$p_field->name' to the value of <input type="text"> fields within the same page.,

So that when I click a menu(from a loop)., a dialog box can determined what menu I had clicked, and pass to a php variable so that active records can be done.,.[/quote]
You could use Ajax.
#13

[eluser]1mr3yn[/eluser]
but how???
#14

[eluser]Thorpe Obazee[/eluser]
[quote author="r3yn" date="1245331239"]but how???[/quote]You could try reading up on Javascript or jQuery, Mootools, etc.

Edit: Using jQuery
Code:
$('.showdetails').click(function(e){
    e.preventDefault();
    var text = $('#yourinput').val($(this).text());
    $.ajax({
        type: "POST",
        url: <?php echo base_url().'here/there/';?>,
        data: "variable=" + text,
        success: function(msg){
            alert( "Data Saved: " + msg );
        }
     });
});
#15

[eluser]1mr3yn[/eluser]
how to use ajax with codeigniter?
#16

[eluser]Thorpe Obazee[/eluser]
[quote author="r3yn" date="1245334749"]how to use ajax with codeigniter?[/quote]

CI is PHP. If you know how to use PHP w/ Ajax then it's just the same. Here's a link to Derek Allard's tutorial using Prototype.
#17

[eluser]1mr3yn[/eluser]
cam you give me a concise overview about this.??
#18

[eluser]Thorpe Obazee[/eluser]
[quote author="r3yn" date="1245335401"]cam you give me a concise overview about this.??[/quote]

I suggest you read up on PHP and Ajax.
#19

[eluser]1mr3yn[/eluser]
Thanks.., I already have the idea...




Theme © iAndrew 2016 - Forum software by © MyBB