Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jayanthi 66 posts 86 karma points
    Oct 17, 2011 @ 13:28
    jayanthi
    0

    Contour submit with ajaxform

    I am using an ajaxform submit for the contour form and my workflows are getting excuted twice.Can any one help me in this respect.

       <script type="text/javascript">   
           $(document).ready(function() {
            var options = {
           beforeSubmit: function() {      
         alert("About to submit");    
       },  // pre-submit callback  
         success: function() { 
              alert("Have submitted"); 
          }  // post-submit callback   
     };  
     $("#Form1").ajaxForm(options);
    </script>

  • Comment author was deleted

    Oct 20, 2011 @ 09:44

    Is the record also stored twice?

  • jayanthi 66 posts 86 karma points
    Nov 01, 2011 @ 13:55
    jayanthi
    0

    yes the record is also saving twice

  • Eric Schrepel 161 posts 226 karma points
    Sep 14, 2013 @ 00:38
    Eric Schrepel
    0

    Similar problem but not with Ajax. Using Contour 3 on Umbraco 6.1.5, we're having various sporadic forms problems:

    Form is tied to a SQL server datasource, also checked the "store locally" checkbox because of odd errors saving to SQL.

    Our issues:

    • Form should save values to SQL then email confirmation to sender. Often, only 1 of those 2 things happens. Found out that field lengths were causing an issue in SQL, tried adding RegEx field validation but it didn't work, so just made all SQL fields varchar(MAX) to accommodate.
    • Sometimes users would get the "thank you" page, but no email confirmation. Cannot figure out why that's the case.
    • Because the Contour form is pretty slow, users sometimes click "Submit" button twice, which creates sometimes 2 records in the local store (one of which ignores some default field values we need stored with it), and anywhere between 0 and 2 records in the SQL store. Can't figure out how to prevent double-clicking, or better, to display some sort of "please wait" dialog to prevent 2nd click.
    Don't know if it's our custom email confirmation page that is causing any issues, but code is below:

    @using System.IO;   

    @{  
        <p>Your comment was received.</p>
        string rec = Model.Record.GetRecordField("Comment").ValuesAsString();
        string attachedfile = Model.Record.GetRecordField("Attach A File").ValuesAsString();
        // trim path from filename
        if(attachedfile!=""){   
           attachedfile = Path.GetFileName(attachedfile);
        }
        
        if (rec!="") {
            <p><strong>Comment: </strong>@rec</p>
        }
        if (attachedfile!="") {
            <p><strong>Attached file: </strong>@attachedfile</p>        
        }        
    }
Please Sign in or register to post replies

Write your reply to:

Draft