Welcome Guest, Not a member yet? Register   Sign In
Yet another form validation question ... You know you can help! :)
#3

[eluser]winterain[/eluser]
As of yesterday, I was using prototype.. as of today, I've switched to jquery completely because it is much simpler to use and noob-friendly. haha.. My problem persists though, this is how I'm handling the ajax..

Code:
var params = $("form#form_comment").serialize();
    $.ajax({
            type: "POST",
            url: base_url+"/music/sendcomment",
            data: params,
            success: function(a){
                $("form#form_comment")[0].reset();
                $("#comm_f_status").hide();
                $("#comm_f_status").html(a);
                $("#comm_f_status").fadeIn('slow');
            }
        });

i figured as long as I can sneak a variable out from Controller and reference it here, I can just add an if statement. Thing is my Controller is echoing the success/failure message.
if I return an object, how can I use it in jquery ?

ie:

Controller:
Code:
$data['msg'] = 'successful!!!';
$data['success'] = TRUE;

back in jquery, it will get that object as ' a ' but how do i get the values inside ?


Messages In This Thread
Yet another form validation question ... You know you can help! :) - by El Forum - 01-09-2009, 05:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB