ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to enter default value in autocomplete field
Title:
B
I
{code}
?
Hi, I want to enter a default value in autocomplete field. How to do this. The placeholder value entered does not seem active while I submit the form. I basically want to retain that default(placeholder) value if I dont select anything from the autocomplete field. Thanks.
Save Changes
Cancel
test
asked at 01 Aug 2016
placeholder in html means a hint, http://www.w3schools.com/tags/att_input_placeholder.asp; and you set an initial value the same as you would for a standard textbox, have you tried anything ?
at 02 Aug 2016
Omu
I tried like @Html.Awe().AutocompleteFor(x => x.NEChannel).value="default!".Placeholder("NE").Parent("TestFIName").Controller("GetData") It does not seem working.
at 03 Aug 2016
test
are you using Visual Studio ?
at 03 Aug 2016
Omu
in VS you have intellisense https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx https://www.youtube.com/watch?v=k6Q0NR2Z0nc .value would not even compile, there is .Value("value") but you don't need that either, you can just set the NEChannel property in controller please watch this: https://www.youtube.com/watch?v=fsfOFL4bXXA to learn mvc
at 03 Aug 2016
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK