Home > Article > Backend Development > Problems with the value of option in select in different browsers
select cannot use php to get the selected value without setting the option value in ie6/7/8. However, in ie9 or above, firefox, and chrome, the value can be obtained whether the value is set or not
For example:
<code><<span>select</span> name=<span>'select_name'> <<span>option</span>><span>1</span></<span>option</span>> <<span>option</span>><span>2</span></<span>option</span>> </<span>select</span>> <<span>select</span> name=<span>'select_name'> <<span>option</span> value=<span>'1'>1<span></option></span> <<span>option</span> value=<span>'2'>2<span></option></span> </<span>select</span>> 第一种情况用$_request[<span>'select_name] 在ie6/7/8取到的值为空</span> 第二种情况用$_request[<span>'select_name] 在ie6/7/8可以取到值</span>在其他游览器中则不受影响 </code>') .addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
The above has introduced the value problem of the option value in select in different browsers, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.