The select is inside a modal, and it is generated with a cycle, and I need in the function to know the specific value of that select
<select id="lote" name="lote" style="width: 100%; height: 100%">
<? while ($registro3=@mysql_fetch_array($rs3) ) {?>
<option value="<? echo $registro3['ID']; ?>" name="<? echo $registro3['ID']; ?>"><? echo $registro3['NOMBRE']; ?></option>
<? }?>
</select>
Este este es el codigo completo del modal:
<div class="modal fade" id="myModal<? echo $registro0['ID']; ?>" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">CREAR NUEVO REPORTE DE CAMPO</h4>
</div>
<div class="modal-body">
<? include('dbconecta.php'); @mysql_query("SET NAMES 'utf8'");
$cadbusca3="select * FROM MA_LOTES where ID_PRODUCTOR='".$registro0['ID']."' ";
$_SESSION['cadbusca_MODAL2']=$cadbusca3;
$rs3 = @mysql_query($cadbusca3);
$rows3 = @mysql_num_rows($rs3);?>
<font>SELECCIONE EL LOTE</font>
<select id="lote" name="lote" style="width: 100%; height: 100%">
<? while ($registro3=@mysql_fetch_array($rs3) ) {?>
<option value="<? echo $registro3['ID']; ?>" name="<? echo $registro3['ID']; ?>"><? echo $registro3['NOMBRE']; ?></option>
<? }?>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">CANCELAR</button>
<button type="button" class="btn btn-primary next-step" onclick="$productor(<? echo $registro0['ID']; ?>);" data-dismiss="modal">GUARDAR</button>
</div>
</div>
</div>