asp.net mvc - MVC Razor Set value of TextBoxFor from Button Group -
i want set value of textboxfor control button group. 1/ not sure how refer texboxfor, have tried eqtype.value = 2
<script> $(".btn-group > .btneqtype").click(function () { $(this).addclass("active").siblings().removeclass("active"); eqtype.value = 2 }); </script> <div class="form-group"> <label class="control-label col-sm-4" for="agd2">set id</label> <div class="col-sm-8 col-md-6"> @html.textboxfor(m => m.etype, new { @class = "input k-textbox", id = "eqtype", value = "3" }) </div> </div>
read on jquery selectors http://www.w3schools.com/jquery/jquery_ref_selectors.asp
<script> $(".btn-group > .btneqtype").click(function () { $(this).addclass("active").siblings().removeclass("active"); $('#eqtype').val("2"); }); </script>
try debugging jquery in chrome developer tools. on webpage press f12 , go console. type in $('#eqtype')
, see returned.
Comments
Post a Comment