facebook

How to send a form

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

    liranmi
    Member

    I created a new screen with some fields as for user inputs and at the bottom of the screen i added a button as “send form” which suppose to send all user inputs fields values to my email ( which i can’t find where to configure it )

    How should i do it using your tool ?

    #331242 Reply

    Dear liranmi:

    I have the same question.

    Do you find the solution?

    If you find the solution will you please let me know; I will
    send you the information if found the solution first.

    Thanks

    #331569 Reply
    #331951 Reply

    welby
    Member

    Hi,

    I am currently evaluating the software before a possible purchase and my intended app relies heavily on gettiing data back in an email form without any interaction from the end user apart from clicking on a submit button.

    I have seen the “On Click” action of “Submit Form” but there is no configuration that is available on this action so it would seem.

    I know I can set up an on click action that calls a javascript function as in another post on the forum:

    function email() {
      var firstname, name, senderemail, message; 
      var url, data, targetemail;
         
      firstname = $('#m1-email-textField1').val();
      name = $('#m1-email-textField2').val();
      senderemail = $('#m1-email-textField3').val();
      message = $('#m1-email-textArea1').val();
      targetemail='email@example.com';
    
      data = firstname + ' ' + name  + "%0D%0A"  //crlf
        + senderemail + "%0D%0A" + message;
    
      url='mailto:' + targetemail + '?subject=Results from iPhone&body=' + data;
    
      window.location.href = url;
    } 

    So my question is what is the actual function of the Submit Form as it would seem on the face of not to perform any action whatsoever?

    Thank you.

    #331970 Reply

    support-michael
    Keymaster

    @welby, et al,

    >my intended app relies heavily on gettiing data back in an email form without any interaction from the end user apart from clicking on a submit button.

    There is no mechanism to silently have your phone send an email without the user’s approval. We are investigating if this is even possible now. In the meantime there are two approaches for your app to send email:

    1) configure a mailto: URL with recipient, subject and body that will open the mail app on the device with a msg prepopulated. All the user has to do is click send. Or user can cancel and close…

    2) send the data to a web service that will mail it to you
    The implication is you have to either have your own emailing service or use a backend service (there are a zillion of these search backend as a service). There are many examples of email web service implementations for every programming language imaginable.

    >what is the actual function of the Submit Form as it would seem on the face of not to perform any action whatsoever?

    The Submit Form action does it job perfectly when used along with a screen that is configured as a Form. The snippet of code you posted is not about a form and it will open the device’s mail client when implemented correctly. But you stated you are looking to silently send email, right?

    How to proceed? Thoughts?

    #331973 Reply

    welby
    Member

    @support-wayne wrote:

    @welby, et al,

    The Submit Form action does it job perfectly when used along with a screen that is configured as a Form.

    Thank you for the reply – appreciated, but can you please expand a little on the above statement?

    Regards,

    Welby

    #331976 Reply

    support-michael
    Keymaster

    @welby

    This conversation gets convoluted for me when a snippet of code is shared that has nothing to do with form/submit. So rather than try to talk to that previous snippet that requires coding and more complex debugging. Here is an example that does not require coding and uses form/submit (the .mobi file attached at bottom of this thread).

    There are different ways to skin the “I want to send email” cat. A super simple approach is to POST a form to a mailto: URL. This assumes you don’t mind using the mail client on the device to actually send the form data.

    1) layout the UI with form fields
    
    2) configure the screens Form properties as shown
      Form: enabled/checked
      Form Method: POST
      Form Action Type: URL
      Form URL: mailto:user@domain.com?subject=<subject>
          for this example <subject> should contain only letters and numbers, i.e., don't add spaces or punctuation... keep it simple
      Form Result Type: none
    
    3) add a button and set its Onclick action to "Submit Form"
    
    That's it. When the user hits submit a precomposed message will be created and opened in the mail composer/app. The form fields will be listed in the body of the message with the format
    
       id1=value1
       id2=value2
       ....
    

    Now test it in Test Center (assume your machine has a mail app registered) or on your iPhone/iPad (use Project>Publish as Mobile WebApplication, here’s link to my test http://goo.gl/smnM0)

    (I’m not sure that this works on android… need to test it)

    See the screenshot of the main screen layout and what happened on my iphone when I clicked the submit button. See attachment email-form-setup.png See attachment iphone-mail-form.png

    Here is the design screen I created. See attachment post-email-form.mobi

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

    welby
    Member

    Wayne,

    much clearer now 🙂

    Basic form functionality built in and if you want to use php mailing you can so do with a small amount of coding.

    It’s all easy if you know where to look so apologies as I am new to your software but I am sure it will become a clearer in time and with help and guidance such as this.

    Thank you.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: How to send a form

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