Form does not send the data to the next page

Asked

Viewed 44 times

0

Hello, I’m making a system of calls to the company where I work, only for T.I. use, because we control by spreadsheet, and I’m having a problem sending the data by POST or GET to the next page, I believe it is because I’m using bootstrap, but I don’t know how to fix it. If anyone can help me, follow the code:

<div class="container col-sm-5">
        <table class="table table-striped">
            <form id="main-contact-form" class="contact-form" name="contact-form" method="get" action="atualiza_Dados_Chamado.php">
                <thead>
                    <tr> <!--ID. -->
                        <th scope="col">ID</th>
                        <?php if($edit == 1): ?>
                            <th scope="col"><input type="text" id="id_Chamado" class="form-control" value="<?php echo $id_Chamado?>" disabled=""></th>
                            <?php
                        endif;
                        if($edit == 0):
                            ?>
                            <th scope="col"><?php echo $id_Chamado; ?></th>
                        <?php endif; ?>
                    </tr>
                </thead>
                <tbody>

                    <tr><!--Status. -->
                        <th scope="row">Status</th>
                        <?php if($edit == 1): ?>
                            <th scope="col">
                                <div class="input-group mb-3">
                                    <select class="custom-select" id="status_Chamado">
                                        <option value="0" <?php if($status == 0)  {echo "selected";}?>>Não atribuido</option>
                                        <option value="1" <?php if($status == 1)  {echo "selected";}?>>Aberto</option>
                                        <option value="5" <?php if($status == 5)  {echo "selected";}?>>Em atendimento</option>
                                        <option value="10" <?php if($status == 10)  {echo "selected";}?>>Fechado</option>
                                        <option value="15" <?php if($status == 15)  {echo "selected";}?>>Cancelado</option>
                                    </select>
                                </div>
                            </th>
                            <?php
                        endif;
                        if($edit == 0):
                            ?>
                            <th scope="col"><?php echo $status_Chamado; ?></th>
                        <?php endif; ?>
                    </tr>

                    <tr><!--Solicitante. -->
                        <th scope="row">Solicitante</th>
                        <?php if($edit == 1): ?>
                            <th scope="col"><input type="text" id="nome_Exibicao" class="form-control" value="<?php echo $dados['nome_Exibicao']?>" disabled=""></th>
                            <?php
                        endif;
                        if($edit == 0):
                            ?>
                            <th scope="col"><?php echo $dados['nome_Exibicao']; ?></th>
                        <?php endif; ?>
                    </tr>
                    <tr> <!-- Data de Abertura -->
                        <th scope="row">Data Abertura</th>
                        <?php if($edit == 1): ?>
                            <th scope="col">
                                <div class="form-group row">
                                    <div class="col-10">
                                        <div class="form-group row">
                                            <div class="col-10">
                                                <input class="form-control" id="date_Time_Abertura" type="datetime-local" value="<?php echo date_format($date_Time_Abert, 'Y-m-d'); echo "T" . date_format($date_Time_Abert, 'H:i')?>" id="example-datetime-local-input">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </th>
                            <?php
                            elseif($edit == 0):
                                ?>
                                <td><?php echo $date_Time_Abertura;?></td>
                            <?php endif; ?>
                        </tr>
                        <tr> <!-- Nome Setor -->
                            <th scope="row">Setor</th>
                            <?php if($edit == 1): ?>
                                <th scope="col"><input type="text" id="nome_Setor" class="form-control" value="<?php echo $dados['nome_Setor']?>"></th>
                                <?php
                            endif;
                            if($edit == 0):
                                ?>
                                <th scope="col"><?php echo $dados['nome_Setor']; ?></th>
                            <?php endif; ?>
                        </tr>
                        <tr> <!-- Título -->
                            <th scope="row">Título</th>
                            <?php if($edit == 1): ?>
                                <th scope="col"><input type="text" id="titulo" class="form-control" value="<?php echo $dados['titulo']?>"></th>
                                <?php
                            endif;
                            if($edit == 0):
                                ?>
                                <th scope="col"><?php echo $dados['titulo']; ?></th>
                            <?php endif; ?>
                        </tr><!-- Descrição -->
                        <th scope="row">Descrição</th>
                        <?php if($edit == 1): ?>
                            <td>
                                <div class="form-group">
                                    <textarea class="form-control" id="descricao" rows="3"><?php echo $dados['descricao']?></textarea>
                                </div>
                            </td>
                            <?php
                        endif;
                        if($edit == 0):
                            ?>
                            <th>
                                <div class="form-group">
                                    <textarea class="form-control" rows="3" disabled=""><?php echo $dados['descricao']?></textarea>
                                </div>
                            </th>
                        <?php endif; ?>
                    </tr>
                    <tr>
                        <th>
                            <div class="row d-flex justify-content-center">
                                <button type="button" class="btn btn-primary" align="center" onclick="window.close()">Cancelar</button>
                            </div>
                        </th>
                        <th>
                            <div class="row d-flex justify-content-center">
                                <button type="submit" class="btn btn-primary" align="center">Atualizar</button>
                            </div>
                        </th>
                    </tr>
                </tbody>
            </form>
        </table>
    </div>
  • Where bootstrap may be influencing?

1 answer

0


You need to use the attribute name for each input.

Example: <input type="text" name="id_chamado">

Also, avoid leaving the attribute disabled empty. Or is true, or is false. As long as it takes false, will not be passed to the action page, even if you have a name.

  • Thank you very much, I re-did the whole code, it was extremely large, as it was the first time I did it was very confusing. As soon as I finish the issues I will try again, thank you very much!!! ^^

Browser other questions tagged

You are not signed in. Login or sign up in order to post.