0
我在xsl(ver = 1.0)中生成以下表單(複選框)。我可以使用下拉菜單生成結果,其中結果中只包含一個選項。使用複選框,當用戶選中多個複選框時,是否可以顯示結果?例如,我需要計數的項目,並顯示這樣的行(下圖)時用戶檢查部門1,部門2和區域1:XSL:使用複選框在XSLT中獲取結果
Search results for: department 1 & 2, region 1
Total: 3 items
department 1: 1 item
department 2: 2 items
region 1: 2 items
lines:
This is line 1 of description of item 1.
This is line 2 of description of item 1.
This is line 3 of description of item 1.
This is line 1 of description of item 2.
This is line 2 of description of item 2.
This is line 3 of description of item 2.
This is line 1 of description of item 3.
This is line 2 of description of item 3.
This is line 3 of description of item 3.
這裏是我的XSL生成形式:
<form action method="post">
<input type="checkbox" name="dept" value="1">1
<input type="checkbox" name="dept" value="2">2
<input type="checkbox" name="region" value="region1">Region1
<input type="checkbox" name="region" value="region2">Region2
<input type="checkbox" name="category" value="category1">Category1
<input type="checkbox" name="category" value="category2">Category2
<input type="text">
<input type="submit" value="SUBMIT">
</form>
的XML是這樣的:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<number>1</number>
<dept>1</dept>
<region>region1</region>
<category>category1</category>
<description>
<pp>
<line>
This is line 1 of description of item 1.
</line>
<line>
This is line 2 of description of item 1.
</line>
<line>
This is line 3 of description of item 1.
</line>
</pp>
</description>
</item>
<item>
<number>2</number>
<dept>2</dept>
<region>region1</region>
<category>category2</category>
<description>
<pp>
<line>
This is line 1 of description of item 2.
</line>
<line>
This is line 2 of description of item 2.
</line>
<line>
This is line 3 of description of item 2.
</line>
</pp>
</description>
</item>
<item>
<number>3</number>
<dept>2</dept>
<region>region2</region>
<category>category2</category>
<description>
<pp>
<line>
This is line 1 of description of item 3.
</line>
<line>
This is line 2 of description of item 3.
</line>
<line>
This is line 3 of description of item 3.
</line>
</pp>
</description>
</item>
</items>
這就是JavaScript是什麼。 –
@MatthewWhited你能提供任何例子嗎? –