Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax with submit form and php
    primarykey
    data
    text
    <p>I am not sure what I am doing wrong. I have searched over multiple forums but did not get a solution. I have the following ajax defined for submitting values from a form. I have the alert function to make sure that this code is being called (which it is), but process.php is not being executed. Any ideas why? Here is the ajax code (my dataString contains the value for all variables and there seems to be no problem with the $_POST variables.</p> <pre><code> // JavaScript Document $(document).ready(function(){ $(".button").click(function() { // validate and process form here //alert("yayyy"); var company = $("input#company").val(); var jobfunc = $("input#jobfunc").val(); var location = $("input#location").val(); var overall = $("input#overall").val(); var detail = $("textarea#detail").val(); var pros = $("textarea#pros").val(); var cons = $("textarea#cons").val(); var sr_mgmt = $("textarea#sr_mgmt").val(); var submitted_by = $("input#submitted_by").val(); var classof = $("input#classof").val(); var school = $("input#school").val(); var anonymous = $("input#anonymous").val(); if (anonymous == 'on') { var anonymous_tmp = 'Y'; } else { var anonymous_tmp = 'N'; } var dataString = 'company=' + company + '&amp;jobfunc=' + jobfunc + '&amp;location=' + location + '&amp;overall=' + overall + '&amp;detail=' + detail + '&amp;pros=' + pros + '&amp;cons=' + cons + '&amp;sr_mgmt=' + sr_mgmt + '&amp;submitted_by=' + submitted_by + '&amp;classof=' + classof + '&amp;school=' + school + '&amp;anonymous=' + anonymous_tmp; alert (dataString); $.ajax( { type:"POST", url:"process.php", data:dataString, success:function() { $('#testimonials').html("&lt;div id='message'&gt;&lt;/div&gt;"); $('#message').html("&lt;h2&gt;Your information has been submitted!&lt;/h2&gt;") .append("&lt;p&gt;Thank you for your help and support.&lt;/p&gt;") .hide() .fadeIn(1500, function() { $('#message').append("&lt;img id='checkmark' src='images/check.png'/&gt;"); }); } }); return false; }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload