Sun Java System Portal Server Mobile Access 7.1 Developer's Reference

AmlForm

Description

An AmlForm is a standard input form added to an AmlPage. This element is used to hold user input elements. When its Submit button is clicked, entered values are accepted and control is transferred to the URL in its URL attribute.

Element Body

(( AmlContainer | AmlGroup | AmlInput | AmlChoice | AmlTextArea | AmlCheckBox | AmlTable | AmlLink | AmlImage | AmlText | AmlBr | AmlList | AmlOrderedList | AmlPCData | AmlSpace )*, AmlStyle?

Parent

Amlpage, AmlGroup

Restrictions

None

AML Attributes

Attribute  

Description  

Possible values  

Default  

Req’d?  

url 

Set submit URL for form 

CDATA 

No Default 

Yes 

encoding 

Set encoding on form’s parameters 

CDATA 

No Default 

No 

inputs 

Deprecated. AmlInputs are automatically handled

CDATA 

No Default 

No 

method 

Set method type for form 

(get|post) 

get 

No 

cache 

Set caching flag 

(true|false) 

true 

No 

view 

Set summary style for HDML protocol 

(summary|linked) 

summary 

No 

submit_label 

Set label for button submitting form contents 

CDATA 

No Default 

No 

reset 

Set reset attribute on AmlForm 

(true|false) 

false 

No 

reset_label 

Set label for button resetting form contents 

CDATA 

No Default 

No 

Markup Language Examples

Sample AML Input:

<AmlDocument>
	<AmlPage>
		<AmlForm>
			<AmlURL action="Zapper">
			<AmlParam name="a" value="z"/>
			<AmlParam name="b" value="x"/>
			</AmlURL>
			<AmlText text="Enter name"/>
			<AmlInput name="n"/>
		</AmlForm>
	</AmlPage>
</AmlDocument>

Sample WML Output:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
	<head>
		<meta http-equiv="Cache-Control" content="max-age=0"/>
	</head>
	<card id="agp0">
		<p align="center"></p>
		<p>Enter name<input emptyok="true" name="n"/></p>
		<do label="submit" type="accept">
		<go href="Zapper?a=z&amp;b=x&amp;n=$(n)" sendreferer="true"
		method="get"/>
		</do>
	</card>
</wml>

Sample cHTML Output:

<html>
	<head>
		<title></title>
		<meta name="PalmComputingPlatform" content="true"></meta>
		<meta http-equiv="Pragma" content="no-cache"></meta>
		<meta http-equiv="Cache-Control" content="no-cache"></meta>
	</head>
	<body>
		<div align="center">
			<a name="agp0"></a>
		</div>
			<form enctype="application/x-www-form-urlencoded" 
						  			action="Zapper" method="get">
			<input name="a" type="hidden" value="z"></input>
			<input name="b" type="hidden" value="x"></input>Enter name
			<input name="n"></input><br>
			<input name="request" type="submit" value="Submit"></input>
			</form>
	</body>
</html>