Content of editor is empty when submitting form #1415

Closed
andreasba opened this Issue Oct 30, 2015 · 2 comments

Projects

None yet

3 participants

@andreasba

Good evening,

forgive me if am doing something wrong here, this is the first time I use GitHub :-)

I love summernote very much, so thanks a lot for all the effort!

I have one issue though: on my local development machine (XAMPP) everything works fine when I use summernote the following way:

 <div class="col-md-12">
                    <div class="form-group">
                        {!! Form::label('description','Beschreibung') !!}
                        {!! Form::textarea('description', null, ['id' => 'summernote_id', 'rows' => '18', 'placeholder' => '']) !!}
                    </div>
                    <p id="textcounter"></p>
                </div>

Which is Blade (PHP Laravel template engine) which produces

 <div class="col-md-12">
                    <div class="form-group">
                        <label for="description">Buch-Beschreibung</label>
                        <textarea id="summernote_id" rows="18" placeholder="" name="description" cols="50"></textarea>
                    </div>
                    <p id="textcounter"></p>
                </div>

And my javascript looks like this:

<script>
    var $max_char;
    $(document).ready(function() {
        $('#summernote_id').summernote({
            styleWithSpan: false,
            lang: "de-DE",
            height: "500px",
            toolbar: [
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['para', ['ul', 'ol']],
                ['misc', ['fullscreen', 'undo', 'redo', 'codeview']]
            ],
            onKeydown:function(e){
                var num = $('#summernote_id').code().length;
                var key = e.keyCode;
                allowed_keys = [8, 37, 38, 39, 40, 46]
                if($.inArray(key, allowed_keys) != -1)
                    return true
                else if(num > 1900){
                    e.preventDefault();
                    e.stopPropagation()
                }
            },
            onKeyup:function() {
                $("#textcounter").text("Noch verfügbare Zeichen: " + (1900 - $(this).val().length));
            }
        });
    });
</script>

But in production (same header includes so jQuery, Summernote etc script are all the same!, also same PHP Version) I have the problem that I type in text but the text is not sent via the POST request.

I found a bug in 2013 where this was discussed and fixed but this cannot be the case here, can it? I use the latest version.

So what could I do to fix this?

Thank you very much
Andreas

@hackerwins hackerwins added a commit that closed this issue Nov 7, 2015
@hackerwins hackerwins Fixed #1415.
 - Recover auto sync on textarea.
ed34610
@hackerwins hackerwins closed this in ed34610 Nov 7, 2015
@hackerwins
Member

@andreasba Thanks for reporting.
textarea auto sync feature was missed on develop branch. I fixed it and this will be released at v0.7.0.

@hackerwins hackerwins self-assigned this Nov 7, 2015
@hackerwins hackerwins added this to the v0.7.0 milestone Nov 7, 2015
@yourchoice

With 0.8.1 textarea autosync doesn't work. #1708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment