facebook

PreSubmit FORM does not copy screen input field data

💡
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 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #341101 Reply

    OS: Win7 Home Premium SP1
    MOBI: 2.3.1 and 2.5 m1 (happens in both)
    2.5 m1 Settings: Apache Cordova 2.2 and iPhone 4/4S IOS: 5.0
    APP: TestFormPresub.mobi and TestFormPresub_custom.js attached
    Wireshark Output: shown below for each case.

    I created a small test program to illustrate a FORM related issue I have been dealing with.

    PROBLEM:
    The form has three fields:
    f1 is filled by the user, f2 and f3 are programmatically filled. The result field is to just display the web page.

    There are two cases of behavior:

    CASE-1:
    I make use of the Pre and Post form submit processing.
    f1 is filled by user. Then submit is pressed.
    In the PRE-SUBMIT area of TestFormPresub_custom.js , code fills out f2 with date and f3 with time in ms format.
    Form gets submitted, however, the URL line does NOT INCLUDE the contents of the f2 and f3 as parameters.
    They are in there, but have no value in them, even though the screen has data in all three fields.
    Incoming web page is code is displayed in the response area, just so I know I got a reply.

    Here is the display from Inspector showing the transmitted URL line with empty f2 and f3 parameters:
    http://bakery-z.com/opt?f1=**********&f2=&f3=&result=&_=1375138416260

    CASE-2:
    Same code with no changes.
    The only difference is I just clear the response area so it does not get transmitted again.
    Notice that all the screen fields are already filled in from the previous transmit.
    Then I press submit.
    The form gets transmitted HOWEVER with f1 without any content.
    f2, and f3 in the URL as have their respective contents included.
    Same display result is received in the response area.

    Here is the display from Inspector showing the transmitted URL line with empty f1 parameter:
    http://bakery-z.com/opt/?f1=&f2=Mon+Jul+29+2013+18%3A14%3A50+GMT-0400+Eastern+Daylight+Time&f3=1375136090507&result=&_=1375136098188

    After many tests and troubleshooting, I decided to control the FORM submission process myself and wrote my code into the documentReadyHandler section. This way I do not make use of the PRE and POST form submit processes.

    CASE-3:
    All my action code is in the documentReadyHandler section.
    I copy/paste the code from preFormSubmit section into documentReadyHandler section.
    I add one line to fill the f1 field in the program.
    The program fills out all three fields.
    No screen entries are needed. The screen shows values for all three fields.
    Then I submit the form using the phoneui.submitForm() function.

    Everything works as it should. The fields are included in the URL with proper values.

    Here is the display from Wireshark showing the transmitted URL line:
    http://bakery-z.com/opt?f1=******************&f2=Mon+Jul+29+2013+18%3A45%3A18+GMT-0400+(Eastern+Daylight+Time)&f3=1375137918355&result=&_=1375137925604

    This problem happens exactly the same way in both 2.3 and 2.5 m1 versions.

    I could not capture the interaction for the iPhone APP because I have no way of intercepting the wireless transmissions with wireshark. However, I know that the problem exists on the phone since I have encountered it in another program I wrote. That is why I started investigating it.

    Unless I am doing something wrong, I believe there might be a problem with handling program-filled field contents in the pre-formSubmit section of MOBI system.

    Thanks to have a look and let me know.

    Turgut

    Attachments:
    You must be logged in to view attached files.
    #341107

    support-michael
    Keymaster

    Thanks for the detailed problem report and the example. I believe this is a bug in the phoneui.submitForm() function. Researching this now and will provide more info asap.

    #341341

    Hello Wayne / Support,

    Any progress on this problem ?

    Thanks,TG

    #341363

    support-michael
    Keymaster

    Hi TG,

    Yes, a fix will be available in the next MobiOne 2.5 milestone-2 (late Aug). In the meantime if you need a quick fix I can describe the 1 line change in phoneui.js.

    #341366

    Hello Wayne,

    Would that be something I can implement and carry on with my development?
    If so I would be interested.

    Thanks, TG

    #341403

    Hi Wayne,

    Awaiting the one-line fix you mentioned.

    Thanks,TG

    #341424

    support-michael
    Keymaster

    The change we are making in the next update (2.5M1) is shown below. In the phoneui.js file’s submitForm() function we are moving the serialization of the form fields/inputs after the preSubmitForm_XXX() callback. You can find phoneui.js file under your project’s www/res folder. See attachment fix-bug24172.png

    Attachments:
    You must be logged in to view attached files.
    #341434

    Thank You Wayne,
    This fixed the problem.

    TG

    #341439

    support-michael
    Keymaster

    Cool! Thx for the follow up.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: PreSubmit FORM does not copy screen input field data

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