Not serializing my forms data

Not serializing my forms data

I have no idea why its not serializing my form's data.

  1. <?php require ('php/bios.php'); ?>

    <script type="text/javascript" src="forms/edit/js/bios.js"></script>

    <!-- Title -->
    <div id="title" class="b2">
        <h2>Character Management</h2>
    </div>
    <!-- Title -->

    <!-- Inner Content -->
    <div id="innerContent">
       
        <form action="#" id="bioForm" >
            <?php
            while ($row = mysqli_fetch_array($groupsResult, MYSQLI_ASSOC)) {
                echo "<fieldset>
                <legend>" . $row['groupName'] . "</legend>";
                $fieldsResult = mysqli_query ( $dbc, sprintf($fieldsQuery,$row['ID']) );
                while ($row2 = mysqli_fetch_array($fieldsResult, MYSQLI_ASSOC)) {
                    echo "<div class=field required>";
                    if ($row2['inputType'] == "text") {
                        echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>";
                        echo "<input type=text name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=text biofield title=" . $row2['fullName'] . " />";    
                    } elseif ($row2['inputType'] == "textarea") {
                        echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>";
                        echo "<textarea name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=textarea biofield title=" . $row2['fullName'] . " />";
                    } else {
                        echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>";
                        echo "<select name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=dropdown biofield title=" . $row2['fullName'] . " >";
                        echo "<option value= >None</option>";
                        if ($styleID == 1 || $styleID == 2 || $styleID == 6) {
                            $charactersQuery = "
                            SELECT
                                characters.ID,
                                characters.characterName
                            FROM
                                characters
                            WHERE
                                characters.styleID = 3
                            ORDER BY
                                characters.characterName";
                        }
                        else {
                            $charactersQuery = "
                            SELECT
                                characters.ID,
                                characters.characterName
                            FROM
                                characters
                            WHERE
                                characters.styleID IN (1,2,6)
                            ORDER BY
                                characters.characterName";
                        }
                       
                        $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query
                       
                        while ( $row3 = mysqli_fetch_array ($charactersResult, MYSQLI_ASSOC)) {
                            echo "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r";
                        }
                       
                        echo "</select>";
                    }
                   
                    echo "</div>";
                }
                echo "</fieldset>";
            }
            ?>
            <fieldset>
                <input type="hidden" name="defaultCharID" id="defaultCharID" value="<?php echo $defaultCharID; ?>" />
                <input type="submit" class="submit" id="editBio" title="Edit Bio" value="Edit Bio" />
            </fieldset>
        </form>

    </div>
    <!-- /Inner Content -->













































































  1. $(document).ready(function() {
        $('div.message-error').hide();
        $('div.message-success').hide();
       
        $("#bioForm").validate({
            submitHandler: function(form) {
                var defaultCharID = $("input#defaultCharID").val();
                var data = $(this).serialize() + '&defaultCharID=' + defaultCharID + '&editBio=True';
                $.ajax({
                    type: "POST",
                    url: "processes/bios.php",
                    data: data,
                    success: function(myNewVar) {
                        if (myNewVar == 'good') {
                            $('div.message-error').hide();
                            $("div.message-success").html("<h6>Operation successful</h6><p>Bio saved successfully.</p>");
                            $("div.message-success").show().delay(10000).hide("slow");
                            $('','#bioForm')
                            .not(':input, :submit, :hidden')
                            .val('');  
                        } else {
                            $('div.message-success').hide();
                            $("div.message-error").html("<h6>Operation unsuccessful</h6><p>Bio was not saved in the database.</p>");
                            $("div.message-error").show();   
                        }
                    }
                });
                return false;
            }   
        });                                                                 
    });