Welcome Guest, Not a member yet? Register   Sign In
Simple explanation needed on jquery
#1

[eluser]bhakti.thakkar[/eluser]
HI all,
I am new to jquery. I am implementing it in my CI application. I have downloaded the latest jQuery JavaScript Library v1.3.2. I got a simple example on the internet and i think of starting with the same. Below is the code in the view page


Code:
[removed]
$(document).ready(function() {
    $('#submit').click(function() {

        var msg = $('#message').val();
        alert(msg);
        $.post("<?=site_url('certificates/AJAXUpdateDB') ?>", {message: msg}, function() {
            $('#message').val('');
        });
    });
});
[removed]

I need to know two things of the bold line:
in the line site_url('message/add') -- i learn that message is a controller and add is a function in it that will execute lines of code. But i dont get the text i.e {message: msg}. if in this case it is the control name(id to be specific) and msg is the value, then how will i pass radio button?
and the second doubt is whether i should use site_url or base_url?

Controller
certificates.php

Code:
function AJAXUpdateDB() {
        print "here";
        $msg = $_POST['message'];

        $stmt="update TransactionCertificate_T set InvoiceReference_VC = '$msg' where TransactionCertificate_ID = '$TransactionCertificate_ID'";
        $this->db->query($stmt);
        return;
    
    }

when i call this, nothing happens.
Where am i wrong


Messages In This Thread
Simple explanation needed on jquery - by El Forum - 04-17-2010, 12:26 AM
Simple explanation needed on jquery - by El Forum - 04-18-2010, 08:29 PM
Simple explanation needed on jquery - by El Forum - 04-19-2010, 02:02 AM
Simple explanation needed on jquery - by El Forum - 04-19-2010, 02:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB