New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form support #1286

Closed
rudygalfi opened this Issue Jan 4, 2016 · 19 comments

Comments

Projects
None yet
@rudygalfi
Contributor

rudygalfi commented Jan 4, 2016

This is mostly a placeholder for now, but this is designed to capture our intent to support forms in some way. This would be targeted at use cases like search, collections of email addresses for newsletters, and many other experiences.

@van-nguyen

This comment has been minimized.

Show comment
Hide comment
@van-nguyen

van-nguyen commented Jan 27, 2016

+1

@rudygalfi rudygalfi added this to the M? milestone Jan 28, 2016

@Noacyl

This comment has been minimized.

Show comment
Hide comment
@Noacyl

Noacyl Feb 17, 2016

The site I am working on also requires the use of Forms.

+1

Noacyl commented Feb 17, 2016

The site I am working on also requires the use of Forms.

+1

@dvoytenko

This comment has been minimized.

Show comment
Hide comment
@dvoytenko

dvoytenko Feb 17, 2016

Collaborator

@Noacyl are you using forms directly? Or do you rely on some service, e.g. mailchimp? If directly:

  1. What's a typical behavior when form is submitted? Redirect or some inline display?
  2. What's a typical behavior on form submission failure?
Collaborator

dvoytenko commented Feb 17, 2016

@Noacyl are you using forms directly? Or do you rely on some service, e.g. mailchimp? If directly:

  1. What's a typical behavior when form is submitted? Redirect or some inline display?
  2. What's a typical behavior on form submission failure?
@kadmos1

This comment has been minimized.

Show comment
Hide comment
@kadmos1

kadmos1 Feb 29, 2016

Hello,

Do you have a general estimate when the form support will be available on AMP?

kadmos1 commented Feb 29, 2016

Hello,

Do you have a general estimate when the form support will be available on AMP?

@dvoytenko

This comment has been minimized.

Show comment
Hide comment
@dvoytenko

dvoytenko Feb 29, 2016

Collaborator

@kadmos1 See the question above (reposting below). We'd really like to get some idea of what the forms would be used for and what you do today.

  1. What's a typical behavior when form is submitted? Redirect or some inline display?
  2. What's a typical behavior on form submission failure?
  3. Are you using mailchip or other similar services? Or mainly running forms directly?

Currently, forms are supported via iframes, so it'd also be nice to hear if this is insufficient for you.

Collaborator

dvoytenko commented Feb 29, 2016

@kadmos1 See the question above (reposting below). We'd really like to get some idea of what the forms would be used for and what you do today.

  1. What's a typical behavior when form is submitted? Redirect or some inline display?
  2. What's a typical behavior on form submission failure?
  3. Are you using mailchip or other similar services? Or mainly running forms directly?

Currently, forms are supported via iframes, so it'd also be nice to hear if this is insufficient for you.

@frnco

This comment has been minimized.

Show comment
Hide comment
@frnco

frnco Mar 8, 2016

@dvoytenko I believe the behavior should be dictated by AMP so as to:

  1. Standardize Form behavior across websites (Predictability);
  2. Optimize said behavior for performance/speed.

Considering where AMP is headed, I believe this should be either a POST or, (preferably I think, as to minimize data transferred), JS (Handled by AMP) that posts the data and renders an AMP-HTML response. But then there is redrawing to think about...

frnco commented Mar 8, 2016

@dvoytenko I believe the behavior should be dictated by AMP so as to:

  1. Standardize Form behavior across websites (Predictability);
  2. Optimize said behavior for performance/speed.

Considering where AMP is headed, I believe this should be either a POST or, (preferably I think, as to minimize data transferred), JS (Handled by AMP) that posts the data and renders an AMP-HTML response. But then there is redrawing to think about...

@dvoytenko

This comment has been minimized.

Show comment
Hide comment
@dvoytenko

dvoytenko Mar 8, 2016

Collaborator

Thanks @frnco . We do currently have amp-mustache that we could use to "re-render" content of the form in case of success/failure. That might work pretty well. We'll definitely consider this.

Collaborator

dvoytenko commented Mar 8, 2016

Thanks @frnco . We do currently have amp-mustache that we could use to "re-render" content of the form in case of success/failure. That might work pretty well. We'll definitely consider this.

@kadmos1

This comment has been minimized.

Show comment
Hide comment
@kadmos1

kadmos1 Mar 15, 2016

Thanks for the idea @dvoytenko iframes may work for us

kadmos1 commented Mar 15, 2016

Thanks for the idea @dvoytenko iframes may work for us

@flacle

This comment has been minimized.

Show comment
Hide comment
@flacle

flacle Mar 19, 2016

@dvoytenko wanted to share one small use case where I think an iframe is not ideal. Imagine a search bar with an auto-suggest feature. The auto-suggest list would be overlaid above elements that are positioned beneath the search bar. With iframes one would need to expand the container (not ideal for dynamic length of a returned set of suggested items), in order to accommodate the items in the list.

flacle commented Mar 19, 2016

@dvoytenko wanted to share one small use case where I think an iframe is not ideal. Imagine a search bar with an auto-suggest feature. The auto-suggest list would be overlaid above elements that are positioned beneath the search bar. With iframes one would need to expand the container (not ideal for dynamic length of a returned set of suggested items), in order to accommodate the items in the list.

@kadmos1

This comment has been minimized.

Show comment
Hide comment
@kadmos1

kadmos1 Mar 21, 2016

I can't find what appears to be the best forum for my question so I'm posting it here,
apologies in advance.

I need to use on an AMP page Google Adsense For Search (AFS) ad units. Is that possible?
I've read AMP documentation and AFS ads aren't available there. I did some research but haven't found any info on this. I've also posted a question in stackoverflow but haven't received any helpful answer. http://stackoverflow.com/questions/35981279/can-i-use-google-adsense-for-search-afs-ad-units-with-amp/36024593#36024593

Can anyone help me with this?
Thanks in advance.

kadmos1 commented Mar 21, 2016

I can't find what appears to be the best forum for my question so I'm posting it here,
apologies in advance.

I need to use on an AMP page Google Adsense For Search (AFS) ad units. Is that possible?
I've read AMP documentation and AFS ads aren't available there. I did some research but haven't found any info on this. I've also posted a question in stackoverflow but haven't received any helpful answer. http://stackoverflow.com/questions/35981279/can-i-use-google-adsense-for-search-afs-ad-units-with-amp/36024593#36024593

Can anyone help me with this?
Thanks in advance.

@dvoytenko

This comment has been minimized.

Show comment
Hide comment
@dvoytenko

dvoytenko Mar 21, 2016

Collaborator

@flacle I see your point. But auto-suggest for search bar is a bit specific case. What do you intend to do with suggested results? Navigate? This may warrant a specialized amp-auto-suggest component.

/cc @ericlindley-g

Collaborator

dvoytenko commented Mar 21, 2016

@flacle I see your point. But auto-suggest for search bar is a bit specific case. What do you intend to do with suggested results? Navigate? This may warrant a specialized amp-auto-suggest component.

/cc @ericlindley-g

@rudygalfi

This comment has been minimized.

Show comment
Hide comment
@rudygalfi

rudygalfi Mar 21, 2016

Contributor

@kadmos1 I've filed #2659 regarding your question. Please use resources like Stack Overflow as you've been doing and if you think you've got a new feature request to raise, please file a new issue.

Contributor

rudygalfi commented Mar 21, 2016

@kadmos1 I've filed #2659 regarding your question. Please use resources like Stack Overflow as you've been doing and if you think you've got a new feature request to raise, please file a new issue.

@flacle

This comment has been minimized.

Show comment
Hide comment
@flacle

flacle Mar 22, 2016

@dvoytenko yes it is a bit specific :) and requests to navigate to another page is one example but also site or content search, where you are filtering an internal search results page, is perhaps a worthy use case to consider.

flacle commented Mar 22, 2016

@dvoytenko yes it is a bit specific :) and requests to navigate to another page is one example but also site or content search, where you are filtering an internal search results page, is perhaps a worthy use case to consider.

@nickblass

This comment has been minimized.

Show comment
Hide comment
@nickblass

nickblass May 9, 2016

@dvoytenko I'd love to have the ability to build form elements using json data and ajax. If possible, I'd like to take it even a step further and have the ability to build dynamic form elements that change based on the previous selections. Our forms are currently setup to send data through ajax. We also have multi-step forms that we'd like to be able to build into the AMP framework. Since author written JavaScript is not allowed, it really handicaps our ability to build custom dynamic solutions. Although iFrames are an okay workaround, I'd like to stay away from that method if at all possible but until there is a better solution, it'll have to work. Thanks for the consideration :D

nickblass commented May 9, 2016

@dvoytenko I'd love to have the ability to build form elements using json data and ajax. If possible, I'd like to take it even a step further and have the ability to build dynamic form elements that change based on the previous selections. Our forms are currently setup to send data through ajax. We also have multi-step forms that we'd like to be able to build into the AMP framework. Since author written JavaScript is not allowed, it really handicaps our ability to build custom dynamic solutions. Although iFrames are an okay workaround, I'd like to stay away from that method if at all possible but until there is a better solution, it'll have to work. Thanks for the consideration :D

@mkhatib

This comment has been minimized.

Show comment
Hide comment
@mkhatib

mkhatib May 18, 2016

Member

@nicblass thanks for the feedback. a lot of what you mentioned might be out of the scope of enabling forms support in AMP but might warrant a special extension if there's a big demand for these kind of flows.

I am working initially on adding the initial support for forms while keeping in mind future features and flows - #3251 - this PR is still early and would probably change a lot as we have a better understanding of the functionality AMP needs to support.

Multi-step forms might be doable by the publishers once we land more features in the future where we could expose more events on the form that you can compose multi-step forms. For example:

<amp-carousel id="multiStepCarouselForm">
  <amp-form on="submit:multiStepCarouselForm.next" action="https://example.com/form/step1">
     ... fields ...
  </amp-form>  
  <amp-form on="submit:multiStepCarouselForm.next"  action="https://example.com/form/step2">
     ... fields ...
  </amp-form>  
  <amp-form on="submit:multiStepCarouselForm.next"  action="https://example.com/form/step3">
     ... fields ...
  </amp-form>  
</amp-carousel>

In theory this should work great, but we're still working on introducing the basic form support for now.

As for dynamic form elements this might be also doable by adding another extension - say amp-dynamic-form.

<amp-dynamic-form form-specs-url="https://example.com/form1.json"></amp-dynamic-form>

This extension would basically defined a specific format for dynamically generated forms - which by its own a big project and might be out of AMP scope this year.

Member

mkhatib commented May 18, 2016

@nicblass thanks for the feedback. a lot of what you mentioned might be out of the scope of enabling forms support in AMP but might warrant a special extension if there's a big demand for these kind of flows.

I am working initially on adding the initial support for forms while keeping in mind future features and flows - #3251 - this PR is still early and would probably change a lot as we have a better understanding of the functionality AMP needs to support.

Multi-step forms might be doable by the publishers once we land more features in the future where we could expose more events on the form that you can compose multi-step forms. For example:

<amp-carousel id="multiStepCarouselForm">
  <amp-form on="submit:multiStepCarouselForm.next" action="https://example.com/form/step1">
     ... fields ...
  </amp-form>  
  <amp-form on="submit:multiStepCarouselForm.next"  action="https://example.com/form/step2">
     ... fields ...
  </amp-form>  
  <amp-form on="submit:multiStepCarouselForm.next"  action="https://example.com/form/step3">
     ... fields ...
  </amp-form>  
</amp-carousel>

In theory this should work great, but we're still working on introducing the basic form support for now.

As for dynamic form elements this might be also doable by adding another extension - say amp-dynamic-form.

<amp-dynamic-form form-specs-url="https://example.com/form1.json"></amp-dynamic-form>

This extension would basically defined a specific format for dynamically generated forms - which by its own a big project and might be out of AMP scope this year.

@jilt

This comment has been minimized.

Show comment
Hide comment
@jilt

jilt May 19, 2016

Working on a dynamic gpg-form for amp website, very interested in this amp-dynamic-form implementation (I need a contact form for every member of a team), thanks a lot for your time and efforts

jilt commented May 19, 2016

Working on a dynamic gpg-form for amp website, very interested in this amp-dynamic-form implementation (I need a contact form for every member of a team), thanks a lot for your time and efforts

@mkhatib mkhatib modified the milestones: Current, Backlog May 23, 2016

@rudygalfi

This comment has been minimized.

Show comment
Hide comment
@rudygalfi

rudygalfi Jun 1, 2016

Contributor

Please note that #3343 is the ITI for Forms support that's currently being worked on. Any feedback, please add it there.

Contributor

rudygalfi commented Jun 1, 2016

Please note that #3343 is the ITI for Forms support that's currently being worked on. Any feedback, please add it there.

@mkhatib

This comment has been minimized.

Show comment
Hide comment
@mkhatib

mkhatib Aug 16, 2016

Member

I am closing this issue, keeping #3343 as the general catch-all forms discussion.

Feel free to open separate issues for other bugs/feature requests.

Member

mkhatib commented Aug 16, 2016

I am closing this issue, keeping #3343 as the general catch-all forms discussion.

Feel free to open separate issues for other bugs/feature requests.

@mkhatib mkhatib closed this Aug 16, 2016

@geofflord

This comment has been minimized.

Show comment
Hide comment
@geofflord

geofflord Sep 15, 2016

I use the "form" tag extensively in Many of my websites with an auto-responder script from "Interspire" for collecting information requests from clients. There is No way that I can change this attribute !!! If this is an option then I am afraid I will not be using ?amp as an option.

geofflord commented Sep 15, 2016

I use the "form" tag extensively in Many of my websites with an auto-responder script from "Interspire" for collecting information requests from clients. There is No way that I can change this attribute !!! If this is an option then I am afraid I will not be using ?amp as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment