select does not have a read-only property, so you need to include a span outside of the select, which can be changed by JS, and you need a friend to refer to the following
In the project development process we often encounter to set the Drop-down box read-only (ReadOnly), but unfortunately the select has no read-only attribute, so you need to include a span outside the select, through JS to change. The following HTML code adds a span tag to the STRUTS2 drop-down tab and makes the dropdown box unreadable when the page is loaded. Code as follows: <body onload= "init ()" > <span id= "Id_select" > <s:select name= "SJDWMC" list= " Sjdxdwlist "listkey=" Dxbh "listvalue=" DWMC "headerkey=" "headervalue=" "></s:select> </span> </body> The following is the JS code, called Selectreadonly in the Init method to make the Drop-down box read-only. Code as follows:/* Set Select to read-only/ function selectreadonly (selectedid) { var obj = based on the ID of the span on the page document.getElementById (selectedid); obj.onmouseover = function () { obj.setcapture (); Obj.onmouseout = function () { obj.releasecapture (); } obj.onfocus = function () { obj.blur (); } obj.onbeforeactivate = function () { return false; } } function init () { Selectreadonly ("Id_select"); } Do this here, try the effect!!!