dushyd
Programmer
- Aug 17, 2012
- 1
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
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
JavaScript:
/ 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
});
}