Skip navigation
Currently Being Moderated

button action with javascript not working

Aug 16, 2012 9:59 AM

Tags: #run #pdf #android #javascript #button

Hi

 

I created a pdf mathematic scool book for children

this book has the option to submit every page as a form to the teacher

on every page on the bottom the student has a button when he clicks it

i run a javascript code that sends the field on the page to the teachers email as a fdf file

 

all is working grate on pc

 

on android when i click the submit button nothig happens.

 

 

this is the code

 

 

 

// send to teacher
var currentDate = new Date()
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
var todayDate = day + "/" + month + "/" + year; 
 
var lineBrake = "%0D%0A";
 
var teacherEmail = getField("email_teacher").value;
var teacherName = getField("name_teacher").value;
 
var studentEmail = getField("email_student").value;
var studentName = getField("name_student").value;
 
if(teacherEmail==""){
    app.alert("enter teachers email");
}
else if(teacherName==""){
    app.alert("enter teachers name");
}
else if(studentEmail==""){
    app.alert("enter student email");
}
else if(studentName==""){
    app.alert("enter students name");
}
else{
               
                var emailSubject = "work page from:" + studentName;
               
                var emailBody = "attached work page from:" + studentName + lineBrake + todayDate;
 
                 
    var aSubmitFields = new Array(
        "lesson1-page8-1a",
        "lesson1-page8-1b",
        "lesson1-page8-1c",
        "lesson1-page8-1d",
        "lesson1-page8-1e",
        "lesson1-page8-1f",
        "lesson1-page8-2b1",
        "lesson1-page8-2b2",
        "lesson1-page8-2b3",
        "lesson1-page8-2c1",
        "lesson1-page8-2c2",
        "lesson1-page8-2c3",
        "email_teacher",
        "name_teacher",
        "email_student",
        "name_student"       
    );
 
 
    this.submitForm({
      cURL: "mailto:"+teacherEmail+"?subject=" + emailSubject + "&body=" + emailBody,
      aFields: aSubmitFields,
      cSubmitAs: "FDF" // the default, not needed here
    });
}
 
 
Replies
  • Currently Being Moderated
    Aug 20, 2012 11:40 AM   in reply to dushy_shtibel

    Adobe Reader for Android does not support JavaScript as actions on buttons. This is something we are considering adding, but we do not yet have any timeframe for availability.

     

    Dennis Griffin

    Adobe

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2012 3:13 PM   in reply to dushy_shtibel

    Adobe Reader for Android does not yet support HTTP submit of form data. It supports sending the PDF as an email attachment. If you have a "Submit" action that sends email on a button, that will trigger this by launching the email app with the PDF attached, for the user to confirm/send. I'm not sure that's what you want, though.

     

    Dennis

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 22, 2012 9:06 AM   in reply to dushy_shtibel

    What is the JavaScript that you are trying to run?

     

    See the first response about JavaScript by David Griffin.

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2013 8:54 AM   in reply to Dennis Griffin (Adobe)

    Hi Dennis,

     

    Is there any update on this? I would like to know if there is any plan to include the javaScript actions on buttons in 2013. I am particularly interested in this action:

     

    this.submitForm({cURL:"myUrl", cSubmitAs: 'PDF'});

     

    With the hight increase on the number of tablet devices out there and BYOD movement, the lack of this functionality is making us to look into different options for collecting data outside Adobe Forms.

     

    Regards,

     

    Renier

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2013 9:16 AM   in reply to valdessir

    This is a User 2 User forum so most of the responders will have no knowledge or if they do because they are included in a Beta test but cannot discuss the possibilities due to non-disclosure agreements and the fact that Beta version's features can change prior to public release.

     

    There is also the fact that different mobile apps work differently with regards to JavaScript.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points