jquery - How to get the text from FormTextBox? -
i have code:
<div class="col-left"> @formtextbox("message:", html.textareafor(m => m.message, new { @class = "required-form-control" })) </div>
now want modify text save it. added button via ajax call. question how in js side?
edit: custom template is:
@helper formtextbox(string labeltext, mvchtmlstring input) { // divs }
under normal circumstances razor engine generate following html when using @html.textareafor
<textarea class="required-form-control" cols="20" id="message" name="message" rows="2"></textarea>
you able access value of element in jquery so:
var check = $('#message').val(); alert(check);
it appear (or team member have created custom display template (@formtextbox) rendered html output may different standard element output text area. if not render id have shown in html edit question include html generated razor , can go there.
Comments
Post a Comment