Copy link to clipboard
Copied
Hello,
In Adobe Animate, is it possible to receive html form data posted? If so please show me the code for getting the html form data, for example getting the data inputted by the user to the text box named 'txtName'.
Another question is, is it possible to let users print some part of the Adobe Animate canvas area by clicking a button on the stage/canvas?
1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use
thank_you.html&username=txtName.text;
2. on the main timeline of thank_you use
var username=parseF(document.location.href)['username'];
function parseF(s){
var a=s.split('&');
var obj = {}
for(i=1;i<a.length;i++){
a=a.split('=');
obj[a[0]]=a[1];
}
return obj;
}
Copy link to clipboard
Copied
1. you need server-side code if you want user input emailed to you or stored in a database.
2. yes, you can use window.print() to print a window object. because you can create a window object using javascript you can print a recreation of part of the animate canvas.
i don't think either task is suitable for novices.
Copy link to clipboard
Copied
Thank you for your reply.
Is there a way to get the posted form data from the previous html page in Adobe CC timeline of the movie and store that value in the variable? How can I get the value inputted by the user on the txtName text box on the previous html page? Is there a simple code such as window.RequestForm() ???
Copy link to clipboard
Copied
you want to get a value from animate to the 'previous' page? how do you get to the 'previous' page from animate?
p.s. you can get the value to the 'next' page if you open that page from animate.
Copy link to clipboard
Copied
What I meant was,
Let's say, I have a html page with a html form with a text box named "txtName" on it and a user entered "Sam" on the text box "txtName" then pressed the submit button on the form.
Then on the next page (the web page which the user has been redirected to after submitting the form), if there's a Adobe animate movie on the page, how can I receive the value inputted by the user "Sam" on the main timeline of the movie?
Are there any simple codes such as window.RequestForm("txtName") to get the value inputted by the user?
Copy link to clipboard
Copied
1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use
thank_you.html&username=txtName.text;
2. on the main timeline of thank_you use
var username=parseF(document.location.href)['username'];
function parseF(s){
var a=s.split('&');
var obj = {}
for(i=1;i<a.length;i++){
a=a.split('=');
obj[a[0]]=a[1];
}
return obj;
}
Copy link to clipboard
Copied
Thank you so much for your help
Copy link to clipboard
Copied
you’re welcome.
Copy link to clipboard
Copied
kglad wrote
1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use
thank_you.html&username=txtName.text;
The beginning of a query string is marked with a question mark, not an ampersand. The ampersand is used to separate fields within the query string.
You should also be using decodeURIComponent() in your code, in case any of ZKM's users have non-ASCII characters in their name.