facebook

Why Form is submitting 3 times

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #327874 Reply

    Craig11
    Member

    Hi.

    I am researching how to leverage backend server (coldfusion, SQL database, email, etc…) with native app.

    I created a form with two fields + a login button.

    – The screen is checked as a Form, Post, URL, Result type is none.
    – Action URL is set to my coldfusion test page which simply inserts a record in DB

    When I test and click the login button (once), I notice that 3 records are inserted into DB.

    Why is it submitted 3 times? I call the URL directly from my browser and it working fine. For some reason the form is being submitted 3 times when clicking on the button.

    Thanks.

    #327880

    Hi Craig11,

    I don’t know exactly what’s going on. Could you share your design files to investigate? You can send them via support at genuitec dot com to keep the data in privacy. Use title: mobione data from Craig11

    #327929

    Craig11
    Member

    Octavio,
    I emailed the files yesterday… Did you get them?

    #327933

    Hi Craig11,

    We’ve received your data and are researching. Will follow up as soon as we know more.

    #328019

    Hi Craig11,

    I ran your code in the debugger and only observed the pre & post form callbacks fire once with each submit. Could you provide more details as to how you’re observing triple submits?

    #328081

    Yann
    Member

    Hi,
    i’ve the same problem wiht xmlHttpRequest
    example:

        function callOtherDomain(url,target)
     {
        // native XMLHttpRequest object
     //alert(url);
       if (window.XMLHttpRequest) {
           req = new XMLHttpRequest();
           req.onreadystatechange = function() {ajaxDone(target);};
           req.open("GET", url, true);
           req.send(null);
       // IE/Windows ActiveX version
       } else if (window.ActiveXObject) {
           req = new ActiveXObject("Microsoft.XMLHTTP");
           if (req) {
             alert(target);
               req.onreadystatechange = function() {ajaxDone(target);};
               req.open("GET", url, true);
               req.send();
           }
       }
           setTimeout("ajax(page,'scriptoutput')", 10000);
    
    }
    //#########################################################################################################################
    function ajaxDone(target) {
       // only if req is "loaded"
        phoneui.showActivityDialog('Chargement...');
       if (req.readyState == 4) {
           // only if "OK"
             if (req.status == 200 || req.status == 304) {
               results = req.responseText;
               document.getElementById(target).innerHTML = results;
           } else {
    
           }
         phoneui.hideActivityDialog();
       }
    }
    
    function loadMeteo()
    {
    
      callOtherDomain("http://xxx.xxxxx.xxx/meteo.aspx","m1-meteo-resultmeteo");
    }
    
     if (newPageId=='#m1-meteo')
      {  
    $("head").append(
           $(" <link href='meteo.css' type='text/css' rel='stylesheet'/>"));
          loadMeteo();
      }
    

    Yann

    #328115

    Hi Yann,

    Could you share your design files with us for help to isolate the problem easier? To keep the data in privacy you can send it via support at genuitec dot com

    #328142

    Yann
    Member

    Hi Octavio
    project sent by email
    Thanks
    Yann

    #328155

    Hi Yann,

    I’ve received and tested your design files, but have not had success to replicate the issue. Could you give me more details like what steps to do and where can I notice about the 3 times action fire?

    #328185

    Craig11
    Member

    In my case, I am submitting to a page on the server that inserts a record on a database. When I submit via mobione app I get 3 records inserted which indicates the requested page gets submiited 3 times. When I call the page directly it works fine and inserts one.

    #328198

    Hi Craig,

    Do you think is possible that we can have access to the data inserted in the database? Will be enough with a simple webpage that show the last records inserted to do some test in the project that you shared with us.

    #328217

    Craig11
    Member

    Haven’t touched this in a few days but I just updated to 2.03 and it appears the issue is gone.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Why Form is submitting 3 times

You must be logged in to post in the forum log in