Skip to content
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
Closed

Form support #1286

rudygalfi opened this issue Jan 4, 2016 · 19 comments

Comments

@rudygalfi
Copy link
Contributor

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.

@shirotech
Copy link

+1

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

Noacyl commented Feb 17, 2016

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

+1

@dvoytenko
Copy link
Contributor

@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?

@ghost
Copy link

ghost commented Feb 29, 2016

Hello,

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

@dvoytenko
Copy link
Contributor

@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
Copy link

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
Copy link
Contributor

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.

@ghost
Copy link

ghost commented Mar 15, 2016

Thanks for the idea @dvoytenko iframes may work for us

@flacle
Copy link

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.

@ghost
Copy link

ghost 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
Copy link
Contributor

@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
Copy link
Contributor Author

@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
Copy link

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.

@webpro-solutions
Copy link

@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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor Author

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

@mkhatib
Copy link
Contributor

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 as completed Aug 16, 2016
@geofflord
Copy link

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
Projects
None yet
Development

No branches or pull requests

10 participants