Send Modal Form does not work

1

Good afternoon. I have a problem when it comes to post the data of a form that is inside a modal. I explain. From an exams.php table I call the modal passing the exam id:

<td><button type="button" class="btn btn-info btn-outline btn-xs" data-toggle="modal" data-target="#message<?php echo $row['id_exam'];?>">Edit</button>
<?php include 'edit_exam_modal.php'; ?></td>

When we give the button, it opens the modal to which the id_exam happened. So far everything works fine: edit_exam_modal:

<div id="message<?php echo $row['id_exam'];?>" tabindex="-1" class="modal fade" role="dialog" aria-labelledby="myModalLabel">

                                     ×

    <h4 class="modal-title">Edit Exam</h4>
  </div>

  <div class="modal-body" style="background-color:#111">
    <input type="hidden" name="idexam" value="<?php echo $papa; ?>">
    <label>Exam type</label>
        <select class="form-control" name="examtype">
            <option><?php echo $row['type']."\n"; ?></option>
            <option>SAT 2016</option>
            <option>SAT</option>
            <option>SAT Subjects</option>
            <option>TOEFL</option>
            <option>ACT</option>
            <option>CLEP</option>
        </select>
    <label>Date</label>
    <input  name="examdate" class="form-control" value="<?php echo $row['date']; ?>" class="form-control" id="focusedInput" type="date" placeholder = "" required>

    <?php
    if ($type == "SAT") {?>

                <label>Critical reading:</label>

                    <input class="form-control" value="<?php echo $row['cr']; ?>" name="cr1" id="focusedInput" type="float">



                <label>Maths:</label>

                    <input class="form-control" value="<?php echo $row['mt']; ?>" name="mt1" id="focusedInput" type="float">



                <label>Writing:</label>

                    <input class="form-control" value="<?php echo $row['wr']; ?>" name="wr1" id="focusedInput" type="float">

    <?php   
    } elseif ($type == "TOEFL") {?>

                <label>TOEFL Score:</label>

                 <input class="form-control" value="<?php echo $row['toefl']; ?>" name="tf1" id="focusedInput" type="float">

    <?php
    } elseif ($type == "CLEP") {?>    

                    <label>CLEP Score:</label>

                     <input class="form-control" value="<?php echo $row['clep']; ?>" name="cl1" id="focusedInput" type="float">

    <?php
    } elseif ($type == "SAT Subjects") {?>

                <label>Subject 1:</label>

                    <input class="form-control" value="<?php echo $row['sb1']; ?>" name="sb11" id="focusedInput" type="float">



                <label>Subject 2:</label>

                    <input class="form-control" value="<?php echo $row['sb2']; ?>" name="sb21" id="focusedInput" type="float">



                <label>Subject 3:</label>

                    <input class="form-control" value="<?php echo $row['sb3']; ?>" name="sb31" id="focusedInput" type="float">

    <?php
    } elseif ($type == "SAT 2016") {?>

                <label>Reading & Writing:</label>

                    <input class="form-control" value="<?php echo $row['rw']; ?>" name="rw" id="focusedInput" type="float">



                <label>Maths:</label>

                    <input class="form-control" value="<?php echo $row['m']; ?>" name="m" id="focusedInput" type="float">



                <label>Essay Reading:</label>

                    <input class="form-control" value="<?php echo $row['er']; ?>" name="er" id="focusedInput" type="float">



                <label>Essay Analysis:</label>

                    <input class="form-control" value="<?php echo $row['ea']; ?>" name="ea" id="focusedInput" type="float">



                <label>Essay Writing:</label>

                    <input class="form-control" value="<?php echo $row['ew']; ?>" name="ew" id="focusedInput" type="float">


    <?php
    } elseif ($type == "ACT") {?>    

                    <label>ACT Score:</label>

                     <input class="form-control" value="<?php echo $row['act']; ?>" name="ac1" id="focusedInput" type="float">


    <?php } ?>
  </div>
  <div class="modal-footer" style="background-color:#111">
    <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
    <button id="update" name="update" class="btn btn-primary">Save changes</button>
    </form>
  </div>
</div>

 call the page edit_exam_save.php and the submit button does not work ... I would need help to be able to send it please.

    
asked by Vieira 16.12.2016 в 17:41
source

1 answer

2

Try to change the type of the button, that is, by default if you want that button to submit, you should specify it

<button type="submit" id="update" name="update" class="btn btn-primary">Save changes</button>

Documentation about the buttons

    
answered by 26.01.2017 в 13:41