public class AmpForm extends AmpComponent
The amp-form extension allows you to create forms to submit input fields in an AMP document.
Constructor and Description |
---|
AmpForm() |
Modifier and Type | Method and Description |
---|---|
String |
getAction()
Specifies a server endpoint to handle the form input.
|
String |
getActionXhr()
Specifies a server endpoint to handle the form input and submit the form via XMLHttpRequest (XHR).
|
List<FormField> |
getFieldset()
List of fields.
|
int |
getMethod()
The method attribute tells the server about the request method.
|
String |
getRequiredScript()
Required script that muct be added to head section.
|
int |
getTarget()
Indicates where to display the form response after submitting the form.The value must be _blank or _top.
|
void |
setAction(String value)
Specifies a server endpoint to handle the form input.
|
void |
setActionXhr(String value)
Specifies a server endpoint to handle the form input and submit the form via XMLHttpRequest (XHR).
|
void |
setMethod(int value)
The method attribute tells the server about the request method.
|
void |
setTarget(int value)
Indicates where to display the form response after submitting the form.The value must be _blank or _top.
|
String |
toAmpHtml()
Represents amp html version of component.
|
String |
toHtml()
Represents html version of component.
|
getAttributes, getFallback, getPlaceholder, setFallback, setPlaceholder
public final int getMethod()
The method attribute tells the server about the request method.
public final void setMethod(int value)
The method attribute tells the server about the request method.
public final int getTarget()
Indicates where to display the form response after submitting the form.The value must be _blank or _top.
public final void setTarget(int value)
Indicates where to display the form response after submitting the form.The value must be _blank or _top.
public final String getAction()
Specifies a server endpoint to handle the form input. The value must be an https URL (absolute or relative) and must not be a link to a CDN
public final void setAction(String value)
Specifies a server endpoint to handle the form input. The value must be an https URL (absolute or relative) and must not be a link to a CDN
public final String getActionXhr()
Specifies a server endpoint to handle the form input and submit the form via XMLHttpRequest (XHR).
public final void setActionXhr(String value)
Specifies a server endpoint to handle the form input and submit the form via XMLHttpRequest (XHR).
public String getRequiredScript()
Required script that muct be added to head section.
getRequiredScript
in class AmpComponent
public String toAmpHtml()
Represents amp html version of component.
toAmpHtml
in class AmpComponent
public String toHtml()
Represents html version of component.
toHtml
in class AmpComponent