Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:25:09+00:00 2026-05-31T05:25:09+00:00

I have this problem with codemirror which is quite tricky and I have no

  • 0

I have this problem with codemirror which is quite tricky and I have no idea how to get around to it.

The data from codemirror just won’t be serialized without the submit event – that’s what I found out so far – like this below,

$(':submit').submit_form();

(function($){
    $.fn.extend({ 
        submit_form: function(options) {

            var defaults = {
            }

            var options =  $.extend(defaults, options);
            var o = options;

            var $cm = this.click(function(e){

                var form = $(this).closest('form');
                alert(form.serialize()); // the textarea field with codemirror returns empty

                $.post(form.attr('action'),form.serialize(),function(xml)
                {
                   ...
                   ...
                }
            });



        }
    });
})(jQuery);

html,

<textarea name="code_1" id="code_1" title="EMBED CODE" class="editor-codemirror" cols="" rows=""></textarea>

I have to change this line

var $cm = this.click(function(e){

to

var $cm = this.submit(function(e){

then the data in the codemirror can be serialised.

but I have to attach the plugin to the click button first and find its closest form and serialise its form data before ajax post. So I must use click event to trace the closest form.

I wonder if anyone has come across this problem before and what is the solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:25:10+00:00Added an answer on May 31, 2026 at 5:25 am

    You’re looking for the save method. http://codemirror.net/doc/manual.html#save

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem.. I'm receiving data from a client..Using a socket connection. But
I have this problem. Any idea? from OpenGL.raw.GLUT import * File /usr/lib/python2.6/site-packages/OpenGL/raw/GLUT/__init__.py, line 6,
I have this problem which I really cannot understand. I am getting info from
i have this problem: starting from an empty list (0 elements) i want check
I have this problem: I am choosing a file from JFileChooser and if i
I have this problem where 2 bars from a different series overlap each other
I have this problem where I have created a User Control which mimics a
I have this problem to solve that I have no idea how to do
I have this problem. I need to do the following: get todays date make
I have this problem. I read with BufferedReader text from one system file, this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.