• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Receiving posted html form data and printing part of the animate canvas area

Community Beginner ,
Jun 27, 2019 Jun 27, 2019

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?

Views

325

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 30, 2019 Jun 30, 2019

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;

}

Votes

Translate

Translate
Community Expert ,
Jun 27, 2019 Jun 27, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 27, 2019 Jun 27, 2019

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()  ???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2019 Jun 28, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2019 Jun 29, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2019 Jun 30, 2019

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;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2019 Jun 30, 2019

Copy link to clipboard

Copied

Thank you so much for your help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2019 Jun 30, 2019

Copy link to clipboard

Copied

you’re welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 01, 2019 Jul 01, 2019

Copy link to clipboard

Copied

LATEST

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.

URL.search - Web APIs | MDN

You should also be using decodeURIComponent() in your code, in case any of ZKM's users have non-ASCII characters in their name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines