facebook

Form Submit to a server PHP – Strange Behavior!

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

    Dear Octavio:

    I am developing an application that has few screens and three forms. The forms will be accessed by customers of my client to: Send Requests, Membership Application and Mobile Banking Subscription. All the three forms send the information vie email to my customer.

    The forms information (Name, Telephone, Address, etc) is sent to an email.php installed
    on the customer hosting for processing.

    Problem:
    The three forms have the same problem.
    For illustration purpose I am going to use the form emailmessage.mobi

    The form emailmessage.mobi is located in a second level menu.
    Example:
    Main Application Screen
    Ist Level Contact US (Menu with various options)
    2nd Level Send us an eMail Message (This option goto the screen
    emailmessage.mobi)

    When the form is “Submitted” http://client.com/email.php is not invoked.

    Partial Solution:
    I found the way for the emailmessage.mobi to work by mistake.

    If I create a button in the Main Application Screen who goes directly to the screen emailmessage.mobi, then the form is processed by the http://www.client.com/email.php and the email is send correctly.

    With the button in the Main Application Screen, I can even call the form thru the menu
    And the form works.

    Strange Behavior!
    It looks like when the functions “Generate Application Files” and “Publish as Mobile Web Application” doesn’t count when a form is called/invoked from a second level menu (Nor call directly from an option in the Main Application Screen).

    This situation doesn’t happen when the application is funned from the “Test Center”. I use an iPhone 3GS iOS 6 for testing purposes.

    I think this have nothing to do with the physical device; can be with the generation of the application file, but you are the specialists.

    Just want to add, that I will appreciate your promptly response, the application is ready for the Apple Store submission and my deadline with my client is almost finished.

    Before asking for your kelp, I was tying to find a solution for almost two weeks, thinking that was a problem with the email.php.

    Additional Information:
    Form Method: Post
    Form Action Type: URL
    Form Action URL: http://www.client.com/email.php
    Form Result Type: Data-Text (AJAX)

    Other Tests Performed:
    I copy the form emailmessage.mobi in a separate directory of my PC.
    I generate a new project with only this form, then published and executed form the iPhone and works fine.

    Thanks in Advance!
    My Best Regards,
    Carlos

    #331883 Reply

    support-michael
    Keymaster

    Hi Carlos,

    >If I create a button in the Main Application Screen who goes directly to the screen emailmessage.mobi, then the form is processed by the http://www.client.com/email.php and the email is send correctly.

    I’m trying to put together a mental pic of what might be happening. The statement above leads me to suspect that emailmessage.mobi is not being processed during code-generation. Let’s try a quick experient and see if my guess is correct.

    1) open your main .mobi file in the Visual Designer
    2) in the Outline select the very top node; the Properties will reveal the main app properties
    3) in the Properties, scroll to the bottom to access the “Additional Files” property. Select it to reveal a file chooser dialog and select the emailmessage.mobi file. This will explicitly force code generation to include the emailmessage.mobi file and all of the files that it references
    4) now generate code, cross fingers and test

    Let us know your outcome.

    Before asking for your kelp, I was tying to find a solution for almost two weeks, thinking that was a problem with the email.php.

    Additional Information:
    Form Method: Post
    Form Action Type: URL
    Form Action URL: http://www.client.com/email.php
    Form Result Type: Data-Text (AJAX)

    This should work but you may have to account for CORS restrictions.

    #331900 Reply

    Dear Wayne:

    The situation is partially solved.

    After adding the emailmessage.mobi to the “Additional Files” property,
    the form start working fine, sending the information via email.

    As mentioned the application has 3 forms and each form has their own
    PHP Script installed in the hosted server

    1. emailmessage.mobi with emailmessage.php
    2. form2.mobi with form2.php (Membership Application)
    3. form3.mobi with form3.php (Mobile Banking Subscription)

    I add the form2.mobi and form3.mobi to the “Additional Files” property and performed the following tests in the iPhone.

    ——————————————————————————————-
    Test 1: In the iPhone 3GS iOS 6
    In the application I select emailmessage.mobi, filled the form information and “Submit” the form.

    Result: (Pass Successfully)
    eMmail message received with all the information entered in the form.
    ——————————————————————————————-

    Test 2: In the iPhone 3GS iOS 6
    In the application I select form2.mobi, filled the form information and “Submit” it.

    Result: (Failed)
    The application is using emailmessage.php instead of form2.php.
    The eMail message received was the same as test 1.
    ——————————————————————————————-

    Test 3: In the iPhone 3GS iOS 6
    In the application I select form3.mobi, filled the form information and “Submit” the form.

    Result: (Failed)
    The application is using emailmessage.php instead of form3.php.
    The eMail message received was the same as test 1
    ——————————————————————————————-

    Conclusion:

    The App is always using the emailmessage.php instead of the php for the corresponding form.

    When I run the application from the “Test Center” all the forms are processed correctly; eMail messages are received with the correct information.

    Looks like some kind of history or cache is holding the emailmessage.mobi information entered and the emailmessage.php, and doen’t released it.

    Notes:
    For information purposes, I haven’t customized or make any changes to the application_custom.js yet, still waiting to solve this situation to do some validations, etc.

    If necessary, I am willing to send you the compete application, just let me know the email address; the zip file is around 4,700 KB.

    I will include as well the three php scripts (one for each form) or I can change the
    eMail address on the scripts to the one you select, in order for you to receive the emails, when the forms are submitted.

    Thanks again.

    #331915 Reply

    Hi Carlos,

    Thank you for follow up with all details about your current status, please send us your project using wetransfer.com to our support email: support at genutiec dot com. Use title Mobione data from CarlosRodriguez, please include your .php files.

    #331917 Reply

    Dear Octavio:

    Information sent as per your instructions.

    Will you please confirm via email, when the information is received by you.

    Thanks in advance,

    Regards

    #331922 Reply

    support-michael
    Keymaster

    @CarlosRodriguez

    I was just scanning our system and still have not received any notification. It could be an issue with our email ticket system as wetransfer is usually quick. Can you resend the bundle using my email: <address removed>
    Please let me know when the data is resent.

    #331924 Reply

    support-michael
    Keymaster

    Carlos,

    This morning I created a simple 2 screen app (A>B), each screen is configured as a form with URL action to separate php handlers. Both screens successfully submit to its respective php handler and returns the correct data. I can share this example only if you wish.

    #331925 Reply

    Files sent via regular Mail.

    Thanks Again.
    Carlos

    #331926 Reply

    support-michael
    Keymaster

    data received

    #331927 Reply

    Thanks Wayne.

    Carlos

    #331960 Reply

    support-michael
    Keymaster

    Hi Carlos,

    Good news! With your help we isolated the issue. Turns out different versions of the webkit browser behave differently w.r.t. internal form lookups. That is why the Test Center and older versions of iOS run successfully. But as you discovered ios6 fails. I’ll update you as soon as we have a fix ready.

    #331983 Reply

    Dear Wayne:

    Excellent !!!!

    I believe that everybody will benefit.

    Regards

    #332116 Reply

    Dear Wayne:

    Any advances?
    Please send me an update!

    Thanks in Advance,
    Carlos

    #332124 Reply

    Hi Carlos,

    We are working on an update. We can make a daily build available if you are open to using it and providing us feedback. The build will basically be 2.2.3 + the form fix.

    #332130 Reply

    Dear Octavio:

    Will you please explain to me what is a “daily build”,
    I don’t have the concept clear.

    Thanks again!
    Carlos

Viewing 15 posts - 1 through 15 (of 20 total)
Reply To: Form Submit to a server PHP – Strange Behavior!

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