]> git.donarmstrong.com Git - neurodebian.git/blobdiff - survey/survey.rst
More figures some fixes.
[neurodebian.git] / survey / survey.rst
index a247b5414dcf1302f0d7cabb56b6f0b942388b3e..a14eec5476ed6faee92048abee0fb74fa074bba4 100644 (file)
@@ -16,6 +16,7 @@ of them.
    // prepare the form when the DOM is ready
    $(document).ready(function() {
        var options = {
+           beforeSubmit:  displayStatus,
            success:       showResponse,  // post-submit callback
            // other available options:
            url: "/cgi-bin/surveycollector.cgi",
@@ -33,11 +34,18 @@ of them.
        }); 
    }); 
 
+   // pre-submit callback 
+   function displayStatus(formData, jqForm, options) { 
+       $('#server_response').html("<emph>Sending survey data. This may take a few moments...</emph>");
+       return true; 
+   } 
+
    function showResponse(data, statusText, xhr, $form)  {
        // reset form if server reports success
        if (data.success == true) {
            $('#nss_survey').resetForm();
-           $('#server_response').html("All good");
+           $('#submit_button').hide();
+           $('#server_response').html(data.results);
        } else {
            $('#server_response').html("");
            alert(data.message);
@@ -671,7 +679,7 @@ Comes with the operating system
 
 .. raw:: html
 
-   </td></tr><tr><td class="response"><input type="checkbox" name="software_resource" value=neurodebian"" /></td><td>
+   </td></tr><tr><td class="response"><input type="checkbox" name="software_resource" value="neurodebian" /></td><td>
 
 `NeuroDebian <http://neuro.debian.net>`_
 
@@ -893,8 +901,8 @@ Real-time solutions
    <td class="response"><input type="checkbox" name="sw_rt" value="preempt_rt" />PREEMPT_RT</td>
    </tr></table>
 
-Psychophysics/Experimental control
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Psychophysics/Experiment control
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. raw:: html
 
@@ -929,7 +937,7 @@ be presented with some statistics computed from all previous participants.
 
 .. raw:: html
 
-   <input value="Go" type="submit">
+   <input id="submit_button" value="Submit survey" type="submit">
    <div id="server_response"></div>
    </form>