ขอความช่วยเหลือพี่ๆในการเขียน jquery หน่อยครับ

( สวัสดีครับ พอดีผมทำเเบบสอบถาม " ใช่ หรือ ไม่ใช่ " อยู่ครับ เเละ ผมมี form radio button ประมาณนี้ครับ โดยส่งค่าลงฐานข้อมูล โดยไม่กด submit ครับ ) โดยที่ ( เมื่อกดปุ่ม radio button ที่มี value="Y" ก็จะเก็บข้อมูลลงฐานข้อมูลไปเลื่อยๆจนกว่า จะมีการกดปุ่ม radio button ที่มี value="N" เมื่อมีการกดปุ่ม radio button ที่มี value="N" ก็จะ redirect ไปที่ description.php )  ตอนนี้ผมติดปัญหาตรงที่ผมต้องการเก็บข้อมูลใน radio button ที่มี value="N" ไปเลื่อยๆ เเต่ข้อมูลในฐานข้อมูลมันกลับไม่เพิ่มตามฟิวล์ที่ผมกำหนดไว้ครับ ข้อมูลมันไปเพิ่มที่เเถวใหม่ครับ ผมต้องการเก็บข้อมูลให้อยู่ตาม id หรือ เเถวของมันครับขอบคุณพี่ๆ ครับ...

-- html -- 
                 <div id="my-form-1">
                   <table class="table table-hover table-bordered border-dark table-sm">
                        <thead class="thead-light">
                            <div>
                                <tr>
                                    <th width="8%" class="text-center" scope="col">ใช่</th>
                                    <th width="8%" class="text-center" scope="col">ไม่ใช่</th>
                                </tr>
                            </div>
                        </thead>
                        <tbody>
                            <div>
                                <tr>
                                    <td align="center"><input type="radio" name="previouslyOrmiscarried_score"
                                            value="Y">
                                    </td>
                                    <td align="center"><input type="radio" name="previouslyOrmiscarried_score"
                                            value="N"></td>
                                </tr>
                            </div>
                            <div>
                                <tr>
                                    <td align="center"><input type="radio" name="pregnancyOrbreastfeeding_score"
                                            value="Y"></td>
                                    <td align="center"><input type="radio" name="pregnancyOrbreastfeeding_score"
                                            value="N"></td>
                                </tr>
                            </div>
                            <div>
                                <tr>
                                    <td align="center"><input type="radio" name="miscarriag_score" value="Y"></td>
                                    <td align="center"><input type="radio" name="miscarriag_score" value="N"></td>
                                </tr>
                            </div>
                        </tbody>
                    </table>
                  .................................... 
                </div>

-- code jquery --
$(function() {
        var text_check_yes = "Y";
        var text_check_no = "N";
        $('#my-form-1').click(function() {
            $(':radio:checked').change(function() {
                var radio_data = $(this).val();
                var sendAlldata = $(this).serialize();
                if (radio_data == text_check_yes) {
                    $.ajax({
                        type: "post",
                        url: "formblood_data.php",
                        data: sendAlldata,
                        success: function() {
                            //////////////////////////////
                        }
                    });
                } else if (radio_data == text_check_no) {
                    $.ajax({
                        type: "post",
                        url: "formblood_data.php",
                        data: sendAlldata,
                        success: function() {
                            alert(window.location.href =
                                'description_formblood.php');
                        }
                    });
                } else {
                    alert('please try again');
                }
            });
        });
    });
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่