Este foro ya no está activo, así que no puedes publicar nuevas preguntas ni responder a las preguntas existentes.

Refrescar select con Jquery??

19 de noviembre de 2015

Hola buenas tengo un select que al darle el submit , independientemente de lo que selecciones , siempre te recoge el último valor:

echo '<div class="modal-header">'; 
    echo    '<button type="button" class="close" data-dismiss="modal">&times;</button>';
    echo    '<h4 class="modal-title">Seleccione Contrato</h4>';
    echo  '</div>';
 
{   
    echo '<div class="modal-body">';   
    echo    '<form  name="formcontract" method="post" action="mira.php" clas="form-horizontal">';
    echo    '<div class="form-group">';
    echo        '<label class="col-sm-3 control-label" for="formGroup" id="contract">Contratos</label>';
 
    echo        '<div class="input-group col-sm-5">';
    echo        '<span class="input-group-addon"><span class="glyphicon glyphicon-list-alt"></span></span>';    
    echo        '<select  name="contrato" class="selectboxit" onchange="mostrarValor(this);">';
    echo '<option selected="disabled">Selecciona un Contrato</option>';
    foreach($incidencias as $cust) 
    { 
 
            echo '<option value="'.$cust->Cdad_disponible.' T de'.$cust->NombreProducto.';">'.$cust->Num_contrato.''.$cust->Num_distribucion.'</option>';
 
    }
 
            echo '</select>';
    echo '</div>';
    echo '</div>';
 
    echo '<div class="col-xs-4">';
    echo '<input type="text" class="form-control"  size="5" name="cupo" id="cupo" disabled/>';
 
    echo '</div>';
    echo '</div>';
    echo '</div>';
    echo '<div class="col-sm-12">&nbsp;</div>';
    echo '<div class="col-sm-12">&nbsp;</div>';
    echo '<div class="col-sm-12">&nbsp;</div>';
 
    /* echo  "Toneladas de "; */
?>
<link rel="stylesheet" href="assets/css/font-icons/font-awesome/css/font-awesome.min.css">  
<?php
 
echo '<div class="modal-header">
 
        <h4 class="modal-title">Autorización de Matrículas</h4>
    </div>
<div class="col-sm-2">&nbsp;</div>
<div class="col-sm-3">&nbsp;</div>
 
 <div class="modal-body">
            <form name="formcontract" method="post" action="mira.php" class="form-horizontal">
 
                    <div class="form-group">
                            <label class="col-sm-3 control-label" for="formGroup">Matrícula</label>
                              <div class="input-group col-sm-5">
                                <span class="input-group-addon"><span class="fa fa-keyboard-o"></span></span>
                              <input class="form-control" type="text" name="matricula"id="formGroup" placeholder="AAA1234">
 
                            </div>
                        </div>  
<div class="col-sm-12">&nbsp;</div>
<div class="col-sm-12">&nbsp;</div>
                    <div class="form-group">
                            <label class="col-sm-3 control-label" for="formGroup">Matrícula Remolque</label>
                              <div class="input-group col-sm-5">
                                <span class="input-group-addon"><span class="fa fa-keyboard-o"></span></span>
                              <input class="form-control" type="text" name="matricular"id="formGroup" placeholder="AAA1234">
 
                            </div>
                          </div>    
<div class="col-sm-12">&nbsp;</div>
<div class="col-sm-12">&nbsp;</div>                     
                    <div class="form-group">
                            <label class="col-sm-3 control-label" for="formGroup">Identificación Chofer</label>
                              <div class="input-group col-sm-5">
                            <span class="input-group-addon"><span class="fa fa-credit-card"></span></span>
                              <input class="form-control" type="text" name="dni" "id="formGroup" placeholder="DNI o PASAPORTE  ">
                                </div>
                        </div>
<div class="col-sm-12">&nbsp;</div>
<div class="col-sm-12">&nbsp;</div>                                 
                    <div class="form-group">
                            <label class="col-sm-3 control-label" for="formGroup">Chofer</label>
                              <div class="input-group col-sm-5">
                            <span class="input-group-addon"><span class="entypo-user"></span></span>
                              <input class="form-control" type="text" name="xofer" id="formGroup" placeholder="Nombre y Apellido">
                                </div>
                        </div>
<div class="col-sm-12">&nbsp;</div>
<div class="col-sm-12">&nbsp;</div>
    <div class="form-group">
                            <label class="col-sm-3 control-label" for="formGroup">P.M.A</label>
                              <div class="input-group col-sm-5">
                            <span class="input-group-addon"><span class="entypo-download"></span></span>
                              <select name="pma" class="selectboxit">
                              <option>40.800</option>
                              <option>41.000</option>
                              <option>44.000</option>
                              </select>
 
                                </div>
                        </div>
 
                                </div>
        <div class="modal-footer">
        <button class="btn btn-success" data-dismiss="modal">Ok</button>
 
                            </div>
</form>';