html - Why is the option text sent when form submitted instead of "value" if value is not set? -


i seeing occur in older version of ie. don't see behavior in chrome or firefox. have form code:

<div class="small-12 medium-3 column hide" id="special-set-div">   <label>special set?     <select id="special-set" name="special_set">       <option value>select</option>       <option value="yes">yes</option>       <option value="no">no</option>     </select>   </label> </div> 

when form submitted, server reading "select" parameter. need manually assign value empty string? there documentation of behaviour? can't seem find mention of this.

thanks in advance help.

this w3c specification states value attribute:

value = string
provides value element. if there isn't, value of option element textcontent of element.

so yes, expected behaviour.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -