Crustamet
Crustamet

Reputation: 104

why form submit returns the text from an select option

why is returning the text when i submit an select post

I have this code

<select name="id_comercial" id="id_comercial" class="form-control">
    <option selected="selected">Select Comercial</option>
    <option value="1">Comercials</option>
</select>

When i submit with the first option in PHP returns "Select Comercial" at

echo $_POST['id_comercial']

returning value = Select Comercial

How can i make my html to return NULL or FALSE or something else but the text

Upvotes: 1

Views: 65

Answers (1)

Stefan Herijgens
Stefan Herijgens

Reputation: 386

Try this:

    <option value="NULL" selected="selected">Select Comercial</option>

:)

Upvotes: 2

Related Questions