facebook

Getting images to submit with form

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

    mthaney4
    Participant

    Hello all,

    I am working on an app, and so far I am learning a lot as I go. But this is a little over my head….

    I want the user to navigate through the pages, and click radio buttons, and fill in some text boxes. On the last page, I have enabled a text area to collect all of the answers from the previous pages in preparation to email the answers as a form. Here are a couple questions I am stumped on:

    1. I know that their is a way to automatically populate the text area without pressing a button I have created to get the values through javascript. I built my app using the things learned from here http://www.genuitec.com/mobile/docs/surveyEmailForm/surveyEmailForm.html but I do not know how to alter the pre-page code to get my values, so I just built a button to run the javascript on a press to get the values.

    2. I have the camera working, and have tested it on an ipad, but I want the images taken to go into some type of local storage to be emailed out with the results from all of the questions when send email is clicked on the last page.

    So far, it is working alright. I could do without automatically getting the values as stated in #1 but I really need to get the photos to email out too.

    I am going to try to attach what I have so far. If you do happen to look at it, the frame side is not even started. If you click on block, it will be where I have been working so far. I am simply going to replicate everything I have learned in the framing side of the app.

    I really am thankful. The last question I had @support-octavio was really helpful and quickly responded.

    Thanks,
    Matt

    It appears that I cannot add an attachment in the forum.

    #344206

    @mthaney4,

    1) If you want to populate your widgets just before a page is visited you should add your custom code in the phoneui.prePageTransition function in your custom.js file:

    Example:

    phoneui.prePageTransition = function(currentScreenId, targetScreenId) {
    
        if (currentScreenId == '#m1-screen1') {
            $('#m1-screen1-textField1').val("Welcome to screen 1");
        }  
    
      return true;
    } 

    2) MobiOne’s email services do not support attachments. You can accomplish this with your own custom implementation that will require proficient with javascript and a server side language skills.

    #344509

    mthaney4
    Participant

    Would it be possible to change the cordova code to get the name from a textbox and affix it to the image?

      function uploadFile(mediaFile) {
            var ft = new FileTransfer(),
                path = mediaFile.fullPath,
                name = mediaFile.name;

    as in name = ?????

    Also, instead of uploading the image to a server it would be cool to just save the image to the ipad with the suffix or prefix associated with the textbox.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Getting images to submit with form

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