• 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 use PHPCBF to fix one issue at a time?

Insert And Retrieve Data in MySQL with $.post Noob Question

Two buttons one form

json_encode turns array into an object

The difference when using if statement true === something() vs something() === true [duplicate]

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Laravel - Browser displays message again when I press back button

Convert regular text to array using notepad++

LARAVEL: How to fetch id dynamically in a query builder?

How to get AJAX to post on second page?

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

301 Redirect to remove query string on homepage only

Add Class in html Dynamically in PHP

How do I pass the dynamic output of a php variable or php function to a CSS variable?

About Contact Privacy policy Terms and conditions