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

Appending Textbox value to Summernote Textarea using Jquery

user7637
1#
user7637 Published in September 19, 2018, 11:24 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

share|improve this question
  • can you post RENDERED html, ie: copy a sample from browser inspector – Scaramouche Apr 16 at 3:29
  • @Scaramouche Ok I will provide Wait for a while – Enrique Gil Apr 16 at 3:41

2 Answers 2

active oldest votes
up vote 1 down vote
You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO