Home Appending Textbox value to Summernote Textarea using Jquery
Reply: 0

Appending Textbox value to Summernote Textarea using Jquery

user2346
1#
user2346 Published in July 19, 2018, 9:58 am

Im new on using Summernote Textarea , and Im having difficulties on passing the value on a summernote textarea. Tried using the conventional .html(), .text() and .val() to pass the value of my dropdown and append it inside the textarea. Here is my set of codes

 $("#btnAddVariable").click(function (e) {
                var eVariable = $("#EmailVariable option:selected").val();
                $("#EmailMessage").val(eVariable);
                $("#EmailMessage").text(eVariable);
                alert(eVariable);
            })

My Dropdown

<div class="form-group">
                                @Html.LabelFor(model => model.EmailVariable, htmlAttributes: new { @class = "control-label col-md-2" })
                                <div class="col-md-6">
                                    @Html.DropDownListFor(model => model.EmailVariable, new SelectList(ViewBag.emailVariables, "Value", "Text"), "Please Select", htmlAttributes: new { @class = "form-control" })
                                   @* @Html.DropDownList(model => model.EmailVariable, new SelectList(ViewBag.emailSender, "Value", "Text"), "Please Select", htmlAttributes: new { @class = "form-control" })*@

                                </div>
                                <div class="col-md-2">
                                    <input type="button" id="btnAddVariable" value="Add Variable" class="btn btn-primary chosen" />
                                </div>
                            </div>

and my Summernote Textarea

<div class="form-group">
                                @Html.LabelFor(model => model.EmailMessage, htmlAttributes: new { @class = "control-label col-md-2" })
                                <div class="col-md-8">
                                    <div class="ibox-content no-padding">
                                        @Html.TextAreaFor(model => model.EmailMessage, new { @class = "summernote", rows = "5", cols = "90" })
                                    </div>
                                </div>
                            </div>

Hoping someone can help me with this. Thanks in Advance

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.53368 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO