Ajax表单提交

Hey guys I'm not getting any post data coming out here, and am pretty positive this isn't working at all. The big deal was it firing a accept/deny with an id # attached, and a value for that forms checkbox. I'm getting no errors, and no warnings so am having an issue stepping through it =( Hopefully another set of eyes?

Sorry ahead of time I know my JQuery blows.

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load("jquery", "1.6");
    </script>

    <script>
        $(".audit").submit(function() 
            { 
                return false; 
            });

        $(".accept, .deny").click(function(event) 
            {
                $form = $(this).parent("form").get(0);
                $gruden = $form(function(index) { attributes.push($(this).val());});
                $.post($form.attr("action"), $form.serialize() + "&submit=" + $(this).attr("value") + "&gruden=" + $gruden, function(data) {

                console.log(data);

            });
        });
    </script>

.......................

<?php foreach($obj->photos as $pending) { ?>

        <div class='container' id='photo-<?=$pending->id;?>'>

            <span class='shadow'>
            <a href='/<?=$pending->large;?>'><img src='http://<?=$_SERVER['HTTP_HOST'].'/'.$pending->small;?>'/></a>
            </span>

            <form class='audit' name='audit-<?=$pending->id;?>' action='<?=$_SERVER['PHP_SELF'];?>'>
            <div class='box'>

                <ul>

                    <li>ID:   <?=$pending->id;?></li>
                    <li>Date: <?=$pending->created_at;?></li>
                    <li>User: <?=$pending->fb_id;?></li>
                    <li>&nbsp;</li>

                    <li>

                        <input class='gruden' value='gruden-<?=$pending->id;?>' type='checkbox' />
                        <a name='submit' value='accept-<?=$pending->id;?>' class='accept' href=''></a>
                        <a name='submit' value='deny-<?=$pending->id;?>' class='deny' href=''></a>

                    </li>

                </ul>

            </div>
            </form>

        </div>

<?php } ?>

This line surely doesn't return your form element as it only looks at the direct parent.

$form = $(this).parent("form");

Try something like this:

$form = $(this).parents("form").get(0);

I think I see your problem now. I've re-written your code so it makes more sense. Comments to explain what's going on

<script>
    $(".audit").submit(function(){ 
            return false; //Preventing the form from submitting if someone hits Enter
    });

    $(".accept, .deny").click(function(event) {
            var form = $("form.audit"); //Always use var to declare variables in Javascript. It's not PHP; we don't use $, unless you want it to be a part of the variable name. Also fixed your selector
            var gruden = $form(function(index) { attributes.push($(this).val());}); //Are you trying to find out if the checkbox with class gruden is checked? Please answer in the comments so I can correct this line
            $.post(form.attr("action") + "&submit=" + $(this).attr("value") + "&gruden=" + gruden, form.serialize(), function(data) { 
                   console.log(data);
            }); //I assume that you want to pass submit and gruden as GET params here, since you're appending them to the URL. If you want them to go as POST vars, then let me know in the comments
    });
</script>

No offense, but I think you might benefit from reading a bit more about Javascript and jQuery. At least read up on how selectors work in jQuery, and some basic Javascript syntax