amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Prepopulate form fill from querystring

Open bjalford opened this issue 9 years ago • 2 comments

Is it possible to prepopulate a form field from a query string in URL?

bjalford avatar Feb 16 '17 15:02 bjalford

@bjalford It is for hidden inputs only AFAIK (@rudygalfi @mkhatib please correct me if I am wrong). hidden inputs support variable substitution (See https://www.ampproject.org/docs/reference/components/amp-form and https://github.com/ampproject/amphtml/issues/6421) and query string params are supported as platform level variables QUERY_PARAM(baz,biz) (See https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md)

aghassemi avatar Feb 16 '17 18:02 aghassemi

Cool, thanks! That meets my use case. Happy for this to be closed unless anyone wants an answer on the non-hidden form fields.

bjalford avatar Feb 16 '17 19:02 bjalford