Default text which won't be shown in drop-down list

后端 未结 8 1490
情话喂你
情话喂你 2020-11-28 02:17

I have a select which initially shows Select language until the user selects a language. When the user opens the select, I don\'t want it to show a

8条回答
  •  日久生厌
    2020-11-28 02:53

    
    

    you can of course move the css to a css file if you want, and put a script to catch the esc button to select the disabled again. Unlike the other similar answers I put value="", this is so if you send the value(s) of your select list with a form, it won't contain "chose something". In asp.net mvc 5 sent as json compiled with var obj = { prop:$('#ddl').val(),...}; and JSON.stringify(obj); the value of prop will be null.

提交回复
热议问题