Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

dropdown error first choice

$
0
0

Hello everyone, this is my first post..jeje

 

 I've a problem with a simple dropdown, the dropdown is populated with mysql table, and everything works fine, but when I use the submit button, in the save.php  doesn't get the first choice of the dropdown! if I select 2nd o 3rd or other..it works..but when I choose the first  it return empty..

 

here my code: 

 

EDIT.PHP

 

 

 <div class="form-row row-fluid">
     <label class="form-label span4" for="tipoproveedor">Tipo Proveedor</label> 
     <div class="span7 controls">
          <select  name="selectTipoProveedor" id="selectTipoProveedor">
                  <option VALUE=<? while ($rowTipoProveedor=mysql_fetch_array($resultTipoProveedor)){
                                                        if($rowTipoProveedor['ClaTipoProveedor'] == $row->ClaTipoProveedor)
                                                            echo '<option selected="selected" value='.$rowTipoProveedor['ClaTipoProveedor'].'>' .$rowTipoProveedor['NomTipoProveedor']. '</option>';
                                                        else
                                                            echo'<option value='.$rowTipoProveedor['ClaTipoProveedor'].'>'.$rowTipoProveedor['NomTipoProveedor'].'</option>';
                                                    }?>
                   </option>
          </select>
  </div>
</div>

 

 

SAVE.PHP

....

 

$tipoprov  = $_POST[selectTipoProveedor];

$test =   "<h2 class=>".$tipoprov."</h2>";

 

 

...

 

Thanks in advance!

 

 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles