• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

JQuery content editable div and text box on submit not sending POST

javascriptphpjqueryhtmltext-editor


PHP Snippet 1:

$(document).ready(function() {
    $("#save").on("click", function(event) {
        var formData = {text: $("#editor").html(), name: $("#name").val()};
        event.preventDefault();
        $.ajax({
            url: 'freewordsave.php',
            type:'POST',
            data: formData,
            success: function(msg)
            {
                alert('Your file was saved!');
            }
        });
    });
});

Related Snippets

How to keep value of selected value after form submission?

Refresh specific HTML content that retrieves data from MySQL

Losing session data after POST from third party website

wordpress : How to specify the cause "This site can’t be reached"

Display a product custom field only in WooCommerce Admin single orders

How to read laravel_session cookies saved in cookie memory of browser in client side?

PHP Warning: Module already loaded in Unknown on line 0

Additional price based on cart item count in WooCommerce

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

Composer Script echo

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

PHP: remove filename from path

WordPress Security Standards want me to escape my html, but how to do it correctly?

About Contact Privacy policy Terms and conditions