Showing value of .serialize

Showing value of .serialize

Well I thought I had it made yesterday when JAKE posted his answer to my post  "Get values from inputs which are array elements"

However I can't get the serialized data to display anywhere. My form has the id="AcctForm". None of the alert(), console.log() or document.write() show anything. In Firefox web tools, under console, the Params show the array of inputs. The Response column shows the script code. Under Network the Params show the array of inputs and Response shows the script code. Under Request payload the string from .serialize() shows. Looks like this AcctFor%5B%5D=rick&InvDate%5B%5D=2020-03-18 ......... What dumb thing have I done to cause this?

Here is the code I have to try to get a display.

  1. <script type="text/javascript" >
    // ==============================================

    $("#AcctForm").on( "submit", function( event ) { 

  2. alert("inside submit function");                            // doesn't show
    var datastring = $("#AcctForm").serialize();
    alert(datastring);                                                 // doesn't show
    document.write(datastring);                               // doesn't show
    console.log(datastring);                                     // doesn't show


    // =================================================



    <div id="wrapper">

    <div id="form_div">
     <form id="AcctForm" method="post" action=""> ..................