c# - Hide multiple Dropdown boxs using CSS for printing -


on c# mvc page, have several dropdown boxs displayed on page, i'm using media query render view differently print , screen.

my question is there way (using css) hide dropdown boxs if selected option value "". (the text value '< select >').

so when printing, following printed:

title  

instead of:

title < select > 

just want make more clear,

if selected option not "" need display when printing, following:

title mr 

will display same when printing as:

title mr  

here 1 of dropdown:

<select id="alias_title" name="alias.title">     <option value="">< select ></option>     <option value="1">mr</option>     <option value="2">mrs</option>     <option value="3">ms</option> </select> 

don't know whether achievable or not css, if not, can done jquery?

thanks

you can use $.fn.filter() find select value "" add hidden class

$(function () {     $('select').filter(function () {         return $(this).val() == "";     }).addclass('hidden'); }); 

add css class

.hidden{   display: none !important; } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -