ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Lookup - Change the value with Jquery.
Title:
B
I
{code}
?
I am trying modify the value of lookup with jquery, but i can't. My source for this value is a action result. this is may actual code: <script type="text/javascript"> function Return3()//dummy function { return 3;} $(function () { $('#Entreprise').ready(function () { $('#Entreprise').val(Return3()).change(); }); }); </script> ad this is the helper implementation: @(Html.Awe().LookupFor(o => o.entrepriseID).Modal(true).Controller<EntrepriseLookupController>()) if I try with this code @(Html.Awe().LookupFor(o => o.entrepriseID).Value(3).Modal(true).Controller<EntrepriseLookupController>()) works very well, but i can't use a function into method Value Ideas?
Save Changes
Cancel
William John Adam Trindade
asked at 16 Apr 2014
in your first attempt you are setting the value on the client side, and it would have worked except it should have been $('#enterpriseID') (the correct id) the second way is server side, you're setting the initial value, which works and you can use a c# function here as well instead of 3, also since you have a viewmodel you can just set the value in the enterpriseID property
at 16 Apr 2014
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