当前位置: 首页 > 网络学院 > 客户端脚本教程 > APPML > form

APPML
AppML HTML 报告
AppML 过滤函数
AppML HTML 列表
AppML HTML 表单
AppML XML 报告

APPML 中的 form


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 292 ::
收藏到网摘: n/a

The <form> element is used to define your own layout of the input form. If this element is omitted, a default layout is used.
<form>元素是用于定义输入表单的布局的。如果忽略该元素,那么将使用一个默认的布局。

All legal HTML elements can be put inside the <form> element.
所有合法的HTML元素都可以写进<form>元素中。

To display the data stored in the database, add id attributes to the form fields that corresponds with the name of the data fields in the recordset (SQL).
为了显示存储在数据库中的数据,可以将id属性添加到与记录集中数据字段名称相一致的表但字段中。

Create form layout with HTML elements:
使用HTML元素创建表单布局:

Note: <table>, <tr>, <td>, <fieldset>, and <legend> (and their attributes) are all standard HTML elements.
注意:<table>、<tr>、<td>、<fieldset>和<legend>(以及它们包含的属性)都是标准的HTML元素。

<?xml version="1.0" ?>
<appml>
<title>Suppliers</title>
<database>
<connection>northwind</connection>
<keyfield>supplierid</keyfield>
<maintable>suppliers</maintable>
<sql>SELECT CompanyName,ContactName,City FROM Suppliers</sql>
</database>
<htmllist />
<htmlform>
<form>
<table width="50%">
<tr>
<td>
<fieldset>
<legend style="color:darkblue;">Supplier information</legend>
<br/>
<table>
<tr>
<td>Company</td>
<td><input size='50' maxlength='40' id='companyname' /></td>
</tr>
<tr>
<td>Contactname</td>
<td><input size='50' maxlength='30' id='contactname' /></td>
</tr>
<tr>
<td>City</td>
<td><input size='50' maxlength='15' id='city' /></td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</form>
</htmlform>
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

Extract data from the record and add it to the legend:
从记录中释放数据并将其添加到Legend中:

<?xml version="1.0" ?>
<appml>
<title>Suppliers</title>
<database>
<connection>northwind</connection>
<keyfield>supplierid</keyfield>
<maintable>suppliers</maintable>
<sql>SELECT CompanyName,ContactName,City FROM Suppliers</sql>
</database>
<htmllist />
<htmlform>
<form>
<table width="50%">
<tr>
<td>
<fieldset>
<legend style="color:darkblue;">
Supplier information for <span id="span_companyname"></span>
</legend>
<br/>
<table>
<tr>
<td>Company</td>
<td><input size='50' maxlength='40' id='companyname' /></td>
</tr>
<tr>
<td>Contactname</td>
<td><input size='50' maxlength='30' id='contactname' /></td>
</tr>
<tr>
<td>City</td>
<td><input size='50' maxlength='15' id='city' /></td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</form>
</htmlform>
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

Create drop-down boxes from the data:
创建下拉框:

<?xml version="1.0" ?>
<appml>
<title>Products</title>
<database>
<connection>northwind</connection>
<keyfield>productid</keyfield>
<maintable>products</maintable>
</database>
<filters>
<orderby>productname</orderby>
</filters>
<htmllist>
<sql>
SELECT products.productname AS Product,
suppliers.companyname AS Supplier,
categories.categoryname AS Category
FROM ((Products
LEFT JOIN suppliers
ON products.supplierid=suppliers.supplierid)
LEFT JOIN categories
ON products.categoryid=categories.categoryid)
</sql>
</htmllist>
<htmlform>
<sql>
SELECT productname,supplierid,categoryid,
quantityperunit,unitprice
FROM products
</sql>
<form>
<table>
<tr>
<td>Product</td>
<td><input size="40" maxlength="40" id="productname" /></td>
</tr>
<tr>
<td>Category</td>
<td>
<field name="categoryid">
<function name="dbselect">
<sql>SELECT categoryid,categoryname
FROM categories ORDER BY categoryname</sql>
<value>categoryid</value>
<options>categoryname</options>
</function>
</field>
</td>
</tr>
<tr>
<td>Supplier</td>
<td>
<field name="supplierid">
<function name="dbselect">
<sql>SELECT supplierid,companyname
FROM suppliers ORDER BY companyname</sql>
<value>supplierid</value>
<options>companyname</options>
</function>
</field>
</td>
</tr>
<tr>
<td>Quantity per unit</td>
<td><input size="40" maxlength="20" id="quantityperunit" /></td>
</tr>
<tr>
<td>Unitprice</td>
<td><input size="40" maxlength="8" id="unitprice" /></td>
</tr>
</table>
</form>
</htmlform>
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

评论 (0) All

登陆 | 还没注册?