asp.net mvc - Get the display value from a DropDown -


I am trying to reach the values ​​in the FormCollection within an action. I'm doing the pricing field:

  var value = formCollection ["MyDropDownList"];  

But I can not find a way to get the display value. Am I missing something obvious? Maybe a cast?

Every option is a bit tricky to get the text To capture the selected option, we use the selected index property of the selection list and then pass this value to the option []. Here is the code

  var w = document.myform.mylist.selectedIndex; Var selected_text = document.myform.mylist.options [w] .text;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -